Previous Page Table of Contents Next Page


Chapter 2
Program AEZCCS01

Program AEZCCS01 accepts a reference file, in the example below named RULES, as input and converts the formatted input data to unformatted random access file format for quick access and efficient processing in programs AEZCCS02 and AEZCCS03. Program execution is controlled by a short control data file, file CTRL01.

2.1 Program Logic and Overview

Given the simple task of program AEZCCS01, the program logic is straightforward. After reading the program control information from file CTRL01, each record of the specified reference data file containing AEZ productivity assessment rules is decoded and processed accordingly. The information is transferred to random access data files for use in programs AEZCCS02 and AEZCCS03.

2.2 Input/Output File Sizes and Connections:

Unit NrFile NameFileb) TypeRecord Length (bytes)Number of Recordsa)File Size (bytes)I/Oc) Mode
5CTRL01FS805400R
6PRINTERFS132V-W
10RULESFS803099247920R
11RND01UR1921800345600W
13RND03UR16013521600W

a) ‘V’ indicates a variable, district or country specific number of records.

b) FS = formatted sequential, UR = unformatted random access.

c) R = input, W = output.

The record length and number of records of the unformatted random access files RND01 and RND03 have been calculated using the parameter constants defined in file MAXDEF.H (see Appendix B). In terms of these constants, the record length of file RND01 is equal to max(2*MCRP, 30+2*(21+MTHZ)), and the record length of file RND03 equals 8*MFGR. The values given in the table above refer to the Kenya Case Study where the number of crops is MCRP=96, the number of thermal zones is MTHZ=9, and parameter constant MFGR=20. Similarly, the number of records can be expressed in terms of these parameter constants that are used to make the computer programs more flexible and more easily adaptable to other environments.

2.3 Subprogram Description:

Name :AEZCCS01
Type:Main program
Purpose :Convert formatted reference/rules input data on crop cycles and suitability rules to unformatted random access files for use in land productivity assessment.
Called by :none
Calls to :CLR2BI, ERROR, MATCH, MAXLGP
Arguments :none
Box Ref. :1.1
  
Name :CLR2BI (buf, n, val)
Type:subroutine
Arguments :integer*20, integer, integer
 bufdata buffer to be zeroed
 nnumber of elements in buffer
 valvalue to be assigned to data buffer elements
Purpose :initialize a 2-byte integer array buf of specified length n to a given value val.
Called by :MAIN
Calls to :none
Box Ref. :none
 
Name :ERROR (ityp, buf, ifatal)
Type:subroutine
Arguments :integer, integer
 ityperror code
 bufline buffer where error occurred
 ifatalerror level
Purpose :Display an error message.
Called by :MAIN
Calls to :none
Box Ref. :none
 
Name :MATCH (ch1, ch2, n)
Type:integer*2 function
Arguments :character* 1, character*l(), integer
 ch1character to be matched
 ch2string to be searched for matching character
 nnumber of characters in ch2 to be tested
Purpose :Test n characters of string ch2 to match character chl.
Called by :MAIN
Calls to :none
Box Ref. :none
 
Name :MAXLGP (LGPbuf)
Type:integer*2 function
Arguments :integer*20
 LGPbuf : character to be matched
NPurpose :Test n characters of string ch2 to match character ch1.
Called by :MAIN
Calls to :none
Box Ref. :none

2.4 Program Control Data, File CTRL01

TABLE 2.1
Control input data for program AEZCCS01

Card Nr.Variable nameData file contentsFormat specification
01FNINPRULES(A50)
02FNRND1RND01I(A50)
03FNRND3RND03I(A50)
04ITECH2(A1)
05IDEBUG0(I1)

Each AEZ-CCS program is controlled by a short input data file which is usually read from standard input. Table 2.1 shows an example used to run program AEZCCS01 setting up table information for intermediate level of input, where

FNINP=name of file (including full path) containing AEZ-CCS productivity assessment rules.
FNRND1=name of unformatted random access file (including full path) containing converted productivity assessment rules for use in programs AEZCCS02 and AEZCCS03.
FNRND3=name of unformatted random access file (including full path) containing converted fallow requirement rules for use in program AEZCCS03.
ITECH=1-digit input level designator :
  1 = low input level
  2 = intermediate input level
  3 = high input level
IDEBUG=1-digit debug level indicator; should be zero under normal operation

2.5 AEZ Productivity Assessment Parameters, File RULES

Land productivity assessment as discussed here is based on the calculation of various multipliers referring to specific attributes of the land inventory entry under consideration. The rules controlling the necessary calculation steps are contained in a rule definition file, named RULES. Each record in the file can be identified by a two character code. So far, eleven different record types have been included in the file :

  1. CC - Cards : Cash crop LGP allocation rules

  2. CN - Cards : Crop cycle requirement rules

  3. CR - Cards : Coarse material rating rules

  4. CY - Cards : Crop yield by LGP

  5. FR - Cards : Fallow land requirements

  6. FY - Cards : Fluvisol LGP rules

  7. PL - Cards : Pattern LGP rules

  8. PP - Cards : Pattern proportion rules

  9. PR - Cards : Phase rules

  10. SR - Cards : Soil suitability rating

  11. TR - Cards : Thermal zone suitability rating rules

The sequence of records in the rule definition file is not important, except that crop cycle requirement rules, i.e. records starting with CN, have to be included at the very beginning of the file. In the following the record format of each of these card types is described. Short illustrative examples can be found in Appendix C.

2.5.1 CC - Card : Cash Crop LGP Allocation Rule

In the current version of the AEZCCS programs the crop production modules for some of the cash-crops have not been fully elaborated. To ensure appropriate allocation of cash-crops under a wide possible range of climatic conditions the CC-cards specify cash-crop LGP allocation rules. For all possible combinations of pattern code and LGP code, each cash-crop is assigned a 1-digit rating, representing decreasing suitability, or 0 in case of unsuitable conditions.

Card PositionContents
1 – 2card lable
3 – 5country code
6 – 83-digit crop code
  9input level code
10 – 11pattern code
12 – 261-digit suitability rating by LGP
(MLGP = 15 entries in the Kenya Case Study)

2.5.2 CN - Card: Crop Cycle Requirement Rules

The CN-cards introduce the crops to be considered in the calculations of the productivity assessment program. The current implementation of the computer program allows for a maximum of 130 crops. Each crop is defined in terms of a 3-digit crop code, average crop cycle length in days, a 20-character text label, and minimum and maximum crop cycle requirements.

Card PositionContents
1 – 2card label
3 – 5country code
6 – 83-digit crop code
9 – 11average crop cycle length (days)
12 – 31character*20 crop text label
32 – 34minimum crop cycle requirement (days)
35 – 38maximum crop cycle requirement (days)
39 – 41sequential crop number
   43crop mask type: l=annual crops, 2=perennial crops, 3=pastures, trees
   44crop type index: l=cereals, 2=pulses, 3=roots,
4=perennial food crops,
5=other cash crops, 6=not used,
U7=pastures,
8=trees with nitrogen fixing abilities,
9=trees without nitrogen fixing abilities
 crops with index > 3 cannot enter sequential crop combinations
   45slope cultivation association table look-up index:
l=dry-land crops, 2=wetland crops, 3=other crops, pastures
   46inter-cropping eligibility indicator
   47water-stress table look-up index
48 – 51yield conversion factor from dry weight to fresh weight
   53vegetation cover factor rule index
   54vegetation cover percentage rule index:
l=annual crops, 2=perennial crops, 3=trees
   55vegetation cover percentage table look-up index, perennial crops
56 – 58percentage of LAI at residual stage in relation to LAI at harvesting stage
59 – 61crop stage distribution (percent): establishment
62 – 64crop stage distribution (percent): early vegetative
65 – 67crop stage distribution (percent): late vegetative
68 – 70crop stage distribution (percent): maturation
71 – 73crop specific multiplier K in crop cover percentage function
74 – 76maximum leaf area index (times 10), annual crops

2.5.3 CR - Card: Coarse Material Rating Rules

The CR-cards describe the crop specific suitability rating in relation to a particular soil texture attribute, called coarse material code. For all possible coarse material codes each crop is assigned a rating 1 to 4 representing suitability quartiles, or 0 in case of lack of suitability.

Card PositionContents
1 – 2card label
3 – 5country code
6input level code
7 – 12character*6 coarse material description label
13 – 14coarse material code
15 – 79coarse material suitability rating by crop 1 to MCPR

In the Kenya Case Study MCRP=96 crops have been considered (see Appendix A). Hence, two lines had to be used per coarse material code, the first line containing ratings for crops 1 to 65, the second line for crops 66 to 96.

2.5.4 CY - Card : Crop Yield by LGP

The CY-cards specify for each crop constraint-free attainable yields by input level and length of growing period zone. The yield figures do not reflect soil related constraints or climatic constraints other than those implied by the LGP code. Temperature requirements of crops or water stress during the growing period are not dealt with in the CY-cards.

Card PositionContents
1 – 2card label
3 – 5country code
6 – 8crop code
  9input level code
10 – 13maximum crop yield (10 kg dry weight per ha)
14 – 17crop yield in LGP 1
18 – 21crop yield in LGP 2
   . 
   . 
   . 
70 – 73crop yield in LGP 15*)

2.5.5 FR - Card: Fallow Land Requirement Rules

FR-cards specify fallow land requirement rules, i.e. the number of years out of a hundred year cycle during which the land is not available for crop cultivation. In the AEZ-CCS methodology, the rest period requirement depends on climate (thermal zone, LGP code), crop type, soil type and input level. In the Kenya Case Study, climatic conditions have been classified into MFGR=20 categories, crop types into four classes. Each record contains all the fallow period requirement coefficients in relation to one particular soil type and crop class at low level of input. The calculation of fallow requirements at input levels other than low is related to the low input fallow requirements.

Card PositionContents
1 – 2card label
3 – 5country code
  6input level code
7 – 9character*3 soil unit label
10 – 12soil unit code
13card sequence number by crop class
14 – 16requirement parameter THZ 1, LGP 60–89 days
17 – 19requirement parameter THZ 1, LGP 90–119 days
20 – 22requirement parameter THZ 1, LGP 120–179 days
23 – 25requirement parameter THZ 1, LGP 180–269 days
26 – 28requirement parameter THZ 1, LGP 270 < days
29 – 31requirement parameter THZ 2/3, LGP 60–89 days
32 – 34requirement parameter THZ 2/3, LGP 90–119 days
   . 
   . 
71 – 73requirement parameter THZ 6/7/8/9, LGP 270 < days

* In the Kenya Case Study 15 length of growing period zones have been delineated. In the computer program the number of LGP codes is defined by parameter constant MLGP (see Appendix A, Table A. 10, and Appendix B).

2.5.6 FY - Card : Fluvisol LGP Suitability Rules

The FY-cards describe the crop specific suitability rating by LGP in relation to cultivation on Fluvisols. For each input level each crop is assigned a maximum yield and for all possible LGP codes a 1-digit rating representing decreasing suitability, or 0 in case of lack of suitability.

Card PositionContents
1 – 2card label
3 – 5country code
6 – 8crop code
  9input level code
10 – 13maximum crop yield (10kg dry weight / ha)
14 – 281-digit suitability rating, by LGP 1 to MLGP*

* In the Kenya Case Study 15 length of growing period zones have been delineated. In the computer program the number of LGP codes is defined by parameter constant MLGP (see Appendix A, Table A. 10, and Appendix B).

2.5.7 PL - Card: Pattern LGP Rules

The PL-cards describe the relationship between inventorized dominant LGP codes and pattern codes by specifying the length of individual component length of growing periods in different pattern groups, e.g in bi-modal rainfall, pattern group L2, an annual length of growing period of 300 – 329 days (LGP code 12) refers to two growing seasons with 180 – 209 days (component LGP code 08) and 120–149 days (component LGP code 06) respectively.

Card PositionContents
1 – 2card label
3 – 5country code
6 – 7pattern code
8 – 9LGP code
10 – 11pattern component LGP LH
12 – 13pattern component LGP L1 
14 – 15pattern component LGP L2 
16 – 17pattern component LGP L21 
18 – 19pattern component LGP L
20 – 21pattern component LGP L3 
22 – 23pattern component LGP L31 
24 – 25pattern component LGP L32 
26 – 27pattern component LGP L33 
28 – 29pattern component LGP L4 
30 – 31pattern component LGP L41 
32 – 33pattern component LGP L42 
34 – 35pattern component LGP L43 
36 – 37pattern component LGP L44 
38 – 39pattern component LGP LD 

2.5.8 PP - Card : Pattern Proportion Rules

PP-cards relate pattern codes to the probability of occurrence of seasonal rainfall conditions.

Card PositionContents
1 – 2card label
3 – 5country code
6 – 7rainfall pattern code
8 – 10probability of occurrence of humid pattern LH 
11 – 13probability of occurrence of uni-modal pattern L1 
14 – 16probability of occurrence of bi-modal pattern L2 
17 – 19probability of occurrence of tri-modal pattern L3 
20 – 22probability of occurrence of pattern L4 
23 – 25probability of occurrence of dry pattern LD 

2.5.9 PR - Card : Phase Rules

The PR-cards describe the crop specific suitability rating in relation to a particular soil phase attribute. For all possible soil phase combination codes each crop is assigned a 1-digit rating (1 to 4 in the Kenya Case Study) representing decreasing suitability, or 0 in case of unsuitable conditions.

Card PositionContents
1 – 2card label
3 – 5country code
  6input level code
7 – 12character*6 phase combination label
13 – 14phase combination code
15 – 791-digit soil phase suitability rating by crop 1 to MCRP*

2.5.10 SR - Card: Soil Unit Rules

The SR-cards describe the crop specific suitability rating in relation to a particular soil type. For all possible soil unit codes each crop is assigned a 1-digit rating (1 to 4 in the Kenya Case Study) representing decreasing suitability, or 0 in case of unsuitable soil conditions

Card PositionContents
1 – 2card label
3 – 5country code
  6input level code
7 – 11soil unit label
12 – 14character* 5 soil unit code
15 – 791-digit soil suitability rating by crop 1 to MCRP*)

* In the Kenya Case Study MCRP=96 crops have been considered (see Appendix A). Hence, two lines had to be used per coarse material code, the first line containing ratings for crops 1 to 65, the second line for crops 66 to 96.

2.5.11 TR- Card: Thermal Zone Suitability Rules

The TR-cards describe the crop specific suitability rating in relation to a particular temperature regime. For each crop a TR-record is required containing a 1-digit suitability rating for each possible thermal zone code (1 to 9 in the Kenya Case Study), or 0 in case of non-suitable thermal zones.

Card PositionContents
1 – 2card label
3 – 5country code
  6input level code (not used)
7 – 93-digit crop code
10 – 181-digit thermal zone suitability rating, by THZ 1 to THZ 9

Previous Page Top of Page Next Page