; Do not change filenames or add or remove FILEI/FILEO statements using an editor. Use Cube/Application Manager.
RUN PGM=MATRIX PRNFILE="{SCENARIO_DIR}\output\MCMAT00A3.PRN" MSG='Preparation for mode choice model'
FILEI ZDATI[2] = "{SCENARIO_DIR}\output\ZONESAT.DAT",
Z=6-10,A1=16-20
FILEI ZDATI[1] = "{SCENARIO_DIR}\input\ZONEDATA_{year}{alt}.DBF"
FILEO RECO[1] = "{SCENARIO_DIR}\output\TAZDATA_{alt}{year}.DBF",
   FIELDS=ZONE,DESCR,SFDU,SF_PCTVNP,SF_PCTVAC,SFPOP,SF_0AUTO,SF_1AUTO,SF_2AUTO,SF3CAR,MFDU,MF_PCTVNP,
           MF_PCTVAC,MFPOP,MF_0AUTO,MF_1AUTO,MF_2AUTO,MF3CAR,HMDU,HMOCC,HMPOP,EMPMFG,EMPIND,EMPCOM,EMPSVC,EMPTOT,SCHENR,SHORTPARK,LONGPARK,
           PCWPRDPK,PCWATTPK,PCWPRDOP,PCWATTOP,AREA_TYPE,CBD_DUMMY,EXU_DUMMY,TERMTIME,PERCAUTO0,PERCAUTO1,PERCAUTO2

PAR ZONES={ZONESI,Spin-INTEGER,"Maximum internal zone number","3700",5,10000} ZONEMSG=100

;**************************************************************
;BEGIN POTENTIAL SCRIPT ADJUSTMENT
;**************************************************************

RO.ZONE=ZI.1.ZONE

RO.SFDU=ZI.1.SFDU
RO.SF_PCTVNP=ZI.1.SF_PCTVNP
RO.SF_PCTVAC=ZI.1.SF_PCTVAC
RO.SFPOP=ZI.1.SFPOP
RO.SF_0AUTO=ZI.1.SF_0AUTO
RO.SF_1AUTO=ZI.1.SF_1AUTO
RO.SF_2AUTO=ZI.1.SF_2AUTO

RO.MFDU=ZI.1.MFDU
RO.MF_PCTVNP=ZI.1.MF_PCTVNP
RO.MF_PCTVAC=ZI.1.MF_PCTVAC
RO.MFPOP=ZI.1.MFPOP
RO.MF_0AUTO=ZI.1.MF_0AUTO
RO.MF_1AUTO=ZI.1.MF_1AUTO
RO.MF_2AUTO=ZI.1.MF_2AUTO

RO.HMDU=ZI.1.HMDU
RO.HMOCC=ZI.1.HMOCC
RO.HMPOP=ZI.1.HMPOP

RO.SHORTPARK=ZI.1.SHORTPARK
RO.LONGPARK=ZI.1.LONGPARK

RO.AREA_TYPE=ZI.2.A1
_atype=ROUND(ZI.2.A1/10)
if (_atype=1) RO.TERMTIME={TERM10}
if (_atype=2) RO.TERMTIME={TERM20}
if (_atype=3) RO.TERMTIME={TERM30}
if (_atype=4) RO.TERMTIME={TERM40}
if (_atype=5) RO.TERMTIME={TERM50}

CBD_DUMMY=0
EXU_DUMMY=0
; define CBD zones for mode chocie
if (ZI.2.A1>10 & ZI.2.A1<20) CBD_DUMMY=1
; define EXURBAN zones for mode choice
if (ZI.2.A1>40 & ZI.2.A1<50) EXU_DUMMY=1

WRITE RECO=1

;**************************************************************
;END POTENTIAL SCRIPT ADJUSTMENT
;**************************************************************

ENDRUN
