The dimensioned variable HOMEPAT is a stock or inventory variable in a system dynamics simulation model. Initial values of this stock are read into the model at HOMPTNA, by a MS C subprogram PARAMID2B.
HOMEPAT[MDSV,MPNT]=Integ((HOMEIN1[MDSV,MPNT]+HOMEIN2[MDSV,MPNT]+
HOMEIN3[MDSV,MPNT]+HOMEIN4[MDSV,MPNT]-HOMEOUT[MDSV,MPNT])/TIME_STEP,
HOMPTNA[MDSV,MPNT])~ p ~| [MDSV=6; MPNT=20]
HOMPTNA[MDSV,MPNT]=INITIAL(PARAMID2B(HOMPTN[MDS1,MPN1],ONDTM78A[MDS1,
MPN1],OSTTM78A[MDS1,MPN1],XNDTM78A[MDS1,MPN1],XSTTM78A[MDS1,MPN1],
RUNOP1[O790],ILONOF[O790],RUNNO,Time,790,255,356,582,684,MEDSA,MLPTA,
NTABN1,NTABN2,OLISTA,NTABNA,1,PNDST))~ p ~|
The external data file for initial values of the stock variable (HOMPTNA) is:
All data files for entities of 2 or more dimensions follow this order. There are many instances of
reading from, and writing to, such data files in this and other models. The issue is: are those
instances correctly programmed in the subprograms concerned?
Listed below are examples of the programming. For each example. please indicate whether the
programming is consistent with the data order in the above file. If not, please correct the code.
________________________________________________________________________
Read into model from paramid2b subprogram data for a parameter or initial value of a stock
for( ndm2 ...
for( ndm1 ...
if( EQUAL(type, ONE)){ // type=integer
paramid2b_v = (REAL)entout2[ndm1 - 1][ndm2 - 1];
} // read into model in same order as stock array dimensions
_______________________________________________________________________
Read into model from lopenwf.c subprogram data for a parameter or initial value of a stock