Role, Lags and Usage from the DIN file


These are somewhat complicated pieces of information about a dynamic model which may need to be communicated to RunDynam via the Dynamic Information (DIN) file.

Role and Lags

RunDynam usually knows what role a logical file plays in the model from information in the TAB file. In particular, RunDynam knows if a logical file is used as input (data is read from it) or is used as output (values are written to it). When a file is used as input, RunDynam also knows whether or not some Coefficients read from the file are updated.

But in some models, a file used as input but having nothing read from it updated, is needed as a lag in a dynamic model. This information cannot be deduced from the TAB file so you need to tell RunDynam about this. You do so by including the key-word lagof in the DIN file line for this logical file and by including the words role lagged-input in that line - see the example below. Note that "role lagged-input" can only be specified if nothing read from the file is updated.

When RunDynam does a simulation, it reads values of Coefficients read from a lagged input file from one period earlier than normal.

Example.

In the MONASH model, logical file EXTRA4 is a lag of file logical file EXTRA. The DIN file contains the line

File EXTRA4 key EX4 lagof EXTRA role lagged-input ;

When doing a simulation for year 2015 of the Base, values of Coefficients are normally read from data files representing year 2014. But, for lagged-input file EXTRA4, data read from it is actually read from the EXTRA file (the file it is a lag of) produced in the simulation for the previous year 2013. So, in the Command file for the simulation for year 2015 of the Base, you will see a line such as

File EXTRA4 = ext-basb-2013.har ;

Role "constant-input" is also allowed when nothing read from the file is updated and this file is not used as a lag. For example, "file INPUT3 key IN3 role constant-input ;". But we know of no practical examples where "role constant-input" is essential in a DIN file.

Usage

Normally files read for the Policy are those produced from earlier periods of the Policy. But, for some models (eg MONASH), some input files are those from earlier periods of the Rerun. Since the TAB file for the model cannot communicate this information, again RunDynam needs to be told about this in the DIN file. The key-word usage is used.

Example.

In the MONASH model, logical file EXTRA3 is a lag of logical file EXTRA. The DIN file contains the line

File EXTRA3 key EX3 usage EXTRA 1 2 2 ;

The 3 numbers "1 2 2" after usage tell RunDynam how to treat this file EXTRA3 in the 3 different types of runs, namely the Base, Rerun and Policy respectively. The "1 2" at the start tell RunDynam to treat it as normal when doing the Base and Rerun. [That is, use Base EXTRA files when doing the Base and Rerun EXTRA files when doing the Rerun.]

The last 2 is the special, non-standard thing about file EXTRA3. This tells RunDynam as follows:

When doing a simulation for year 2015 of the Policy, values of Coefficients read from file EXTRA3 are read from the EXTRA file produced in the Rerun (not the Policy) for year 2014. The last "2" in the line above is what signals this.

So, in the Command file for the simulation for year 2015 of the Policy, you will see a line such as

File EXTRA3 = ext-bs1b-br1r-2014.har ; ! Use 2014 file produced in Rerun

[If "usage 1 2 3" were in the line, that line of the Command file would be something like "File EXTRA3 = ext-bs1b-br1r-pl1p- 2014.har ;" where the file from the previous year of the Policy is read.]

As indicated above, the three numbers after usage tell RunDynam how to treat the file in the Base, Rerun and Policy respectively. Normal values for "usage" is

"usage <file-name> 1 2 3"

which means no change from the normal. But

"usage <file-name> 1 2 2"

is what signals that, in the Policy (the last of the 3 runs) values of this file are taken from the Rerun (the second of the 3 runs).

Example 2.

In the section above about roles and lags, we showed the DIN file statement for file EXTRA4 from the Monash model. In fact the full line for EXTRA4 is:

File EXTRA4 key EX4 lagof EXTRA role lagged-input usage EXTRA 1 2 3;

Here the usage numbers are the "standard" 1 2 3, so EXTRA4 is treated as normal in the 3 runs Base, Rerun and Policy. For example, in the Command file for year 2015 of the Policy you will see the line

File EXTRA4 = ext-bs1b-br1r-pl1p-2013.har ; ! Use 2013 file produced in Policy

The 2013 file is used because EXTRA4 is a lagged-input. The file from year 2013 of the Policy is used because the last usage integer is 3 (which means use Policy files when doing the Policy).



URL of this topic: www.copsmodels.com/webhelp/rundynam/hc_dinrole.htm

Link to full GEMPACK Manual

Link to GEMPACK homepage