The MODINPUTORDER option controls whether the equations in a simultaneous block of a model are executed in the order in which you place them or in an order determined by the model compiler. MODINPUTORDER has no effect on the order of equations in simple blocks and step blocks.
See:
"Model Options" for descriptions of all of the options that control the solution of simultaneous blocks.The equations in a simultaneous block of a model are executed in the order in which they appear in the model.
(Default) The equations in a simultaneous block are executed in an order determined by the model compiler.
Example 5-55 Using the Default Order
The following statements define the income.calc
model.
DEFINE income.calc MODEL MODEL DIMENSION line month Net.Income = Opr.Income - Taxes Opr.Income = Gross.Margin - TOTAL(Marketing + Selling + R.D) Marketing = LAG(Opr.Income, 1, month) Gross.Margin = Revenue - Cogs END
The following statements compile the model and produce a compilation report using the MODEL.COMPRPT program.
COMPILE income.calc MODEL.COMPRPT income.calc
These statements produce the following output.
MODEL INCOME.CALC <LINE MONTH> BLOCK 1 (SIMPLE) INCOME.CALC 5: gross.margin = revenue - cogs BLOCK 2 (SIMULTANEOUS <MONTH>) INCOME.CALC 4: marketing = lag(opr.income, 1, month) INCOME.CALC 3: opr.income = gross.margin - total(marketing + selling + r.d) END BLOCK 2 INCOME.CALC 2: net.income = opr.income - taxes END BLOCK 1
When you compile income.calc
with MODINPUTORDER set to its default value of NO
, you can see that the compiler reverses the order of the equations in the simultaneous block.
Example 5-56 Changing the MODINPUT Value
The following statements set the value of MODINPUTORDER to YES
, compile the model, and produce a compilation report.
MODINPUTORDER = YES COMPILE income.calc MODEL.COMPRPT income.calc
These statements produce the following output.
MODEL INCOME.CALC <LINE MONTH> BLOCK 1 (SIMPLE) INCOME.CALC 5: gross.margin = revenue - cogs BLOCK 2 (SIMULTANEOUS <MONTH>) INCOME.CALC 3: opr.income = gross.margin - total(marketing + selling + r.d) INCOME.CALC 4: marketing = lag(opr.income, 1, month) END BLOCK 2 INCOME.CALC 2: net.income = opr.income - taxes END BLOCK 1
You can see that the compiler leaves the simultaneous equations in the order in which you placed them.