The XML input deck is the XML implementation of the free format input deck.
The XML input deck Document type defination (DTD) is given at the end of
this file. It is recommended to include the DTD at the beginning of your XML
input deck. With DTD, the XML parser can validate your XML input deck.
The contents (items) of the entire input deck are enclosed by the tag
<XRTInputDeck> </XRTInputDeck>
Inside the <XRTInputDeck> </XRTInputDeck>, there could be the following items:
  1) Period          --- should have excatly one occurrence,
  2) TimeStepInHour  --- should have exactly one occurrence,
  3) StateOutStep    --- should have exactly one occurrence,
  4) RoutingOutStep  --- should have exactly one occurrence,
  5) OutDir          --- should have exactly one occurrence,
  6) ParamDir        --- should have exactly one occurrence,
  7) XmrgDir         --- should have exactly one occurrence,
  8) SeqFile         --- optinal, should have no more than one occurrence,
  9) window          --- optinal, should have no more than one occurrence,
  10)subWindow       --- can have arbitrary number of occurrence,
  11)runOffModelInfo --- should have exactly one occurrence,
  12)routingModelInfo--- optinal, should have no more than one occurrence,
  13)snowModelInfo   --- optinal, should have no more than one occurrence,
  14)frzGrdInfo      --- optinal, should have no more than one occurrence,
  15)BasinInfo       --- should have at least one occurrence,
A. The <XRTInputDeck></XRTInputDeck> document
1. The item of <Period> </Period> defines the simulation period. It has
   a <Start></Start> tag and a <End></End> tag, each has three items,
    <year></year>, <month></month>, <day></day> and <hour></hour>
   This item is not optional. Every input deck must have exactly one
   <Period> </Period> tag
   Example:
        <Period>
                <Start>
                        <year>1998</year>
                        <month>10</month>
                        <day>1</day>
                        <hour>0</hour>
                </Start>
                <End>
                        <year>1999</year>
                        <month>4</month>
                        <day>30</day>
                        <hour>23</hour>
                </End>
        </Period>
   The simulation period is Oct. 1, 1998 0 to Apr. 30, 1999 23.
2. The <TimeStepInHour></TimeStepInHour> item specifies simulation time step.
   The unit must be in hours.
   This is not optional. Every input deck must have
   exactly one <TimeStepInHour></TimeStepInHour> tag.
   Example:
      <TimeStepInHour>6</TimeStepInHour>
   The simulation time step is 6 hours.
3. The <StateOutStep></StateOutStep> item specifies how often the runoff states
   are going to be output in XMRG parameter grid format. It is in number of
   time steps.
   This is not optional. Every input deck must have
   exactly one <StateOutStep></StateOutStep> tag.
   Example:
      <StateOutStep>2</StateOutStep>
   The runoff states are going to be output every 2 time step. That is every
   12 hours, if the simulation time step is 6 hours.
4. The <RoutingOutStep></RoutingOutStep> item specifies how often the routing
   states are going to be output in XMRG parameter grid format.
   It is in number of time steps.
   This is not optional. Every input deck must have exactly one this tag.
   Example:
      <RoutingOutStep>2</RoutingOutStep>
   The routing states are going to be output every 2 time step. That is every
   12 hours, if the simulation time step is 6 hours.
5. The <OutDir> </OutDir> item specifies the output directory. Every output
   file is going to be written to this directory.
   This is not optional. Every input deck must have exactly one this tag.
   Example:
      <OutDir>/tmp/hwbasin_frz</OutDir>
6. The <ParamDir> </ParamDir> item specifies where the parameter files are
   going to be read.
   This is not optional. Every input deck must have exactly one this tag.
   Example:
      <ParamDir>/fs/hsmb/hydro/rms/parameterslx/marfc</ParamDir>
7. The <XmrgDir> </XmrgDir> item specifies where the XMRG precipitation files
   are going to be read.
   There are three attributes in this item, "YearDigits", "isBigEndian" and
   "lumped".
   "YearDigits" specifies how many characters donating year in the XMRG file
   names. It is either 4 and 2. The default value is 4.
   "isBigEndian" specifies whether the XMRG files were created on a big endian
   machine. It is either "true" or "false". The default value is "true".
   This is not optional. Every input deck must have exactly one this tag.
   "lumped" specifies whether using lumped lumped precipitation.  It is either
    "true" or "false". The default value is "false". If it is "true", the
    pricipitation will be averaged over each selected basin. The averaged
    value is going to be used for each pixel inside the basin.
   This is not optional. Every input deck must have exactly one this tag.
   Example:
       <XmrgDir YearDigits="4" isBigEndian="false" lumped="false" >
               /fs/hsmb/hydro/rms/parameterslx/abrfc4x4
       </XmrgDir>
8. The <SeqFile> </SeqFile> item specifies the sequential file.
   This is optional. Every input deck may have at most one this tag.
   Example:
       <SeqFile>/fs/hsmb/hydro/users/vkoren/devl/spk4x4.con</SeqFile>
9. The <runOffModelInfo> </ruuOffModelInfo> item specifies the runoff model. It
   has three attributes, "name", "GridNum", "ParNum" and "StateNum".
   "name" gives the name of the runoff model. It could be "SAC_SMA" or "API".
   The default is "SAC_SMA".
   "GridNum" gives the number of grids that will be used to define actual model
             parameters.  The default value is 17.
   "ParNum" gives the actual number of runoff model parameters.  For SAC-SMA
            "ParNum" is the same as "GridMum" because there is no any
            grid transformation procedures. The default value is 17.
   "StateNum" gives the number of runoff model states.  The default value
            is 6.
    This is not optional. Every input deck must have exactly one this tag.
    Example:
     <runOffModelInfo name="SAC_SMA" GridNum="17" ParNum="17" StateNum="6"/>
10.The <routingModelInfo> </routingModelInfo> item specifies the routing model.
   It has three attributes, "name", "GridNum", "ParNum" and "StateNum".
   "name" gives the name of the routing model. Currently, only routing one
   model is supported by HLRMS. That is "KINEMATIC".
   The default is "KINEMATIC".
   "GridNum" gives the number of grids that will be used to define actual model
             parameters.  The default value is 9.
   "ParNum" gives the actual number of routing model parameters.  The default
            value is 3.
   "StateNum" gives the number of runoff model states.  The default value
            is 2.
    This is optional. Every input deck may have at most one this tag.
    Example:
      <routingModelInfo name="KINEMATIC" GridNum="7" ParNum="3" StateNum="2"/>
11.The <snowModelInfo> </snowModelInfo> item specifies the snow model.
   It has three attributes, "name", "GridNum", "ParNum" and "StateNum".
   "name" gives the name of the snow model. Currently, only one snow model is
    supported by HLRMS. That is "SNOW17".
   The default is "SNOW17".
   "GridNum" gives the number of grids that will be used to define actual model
             parameters.  The default value is 25.
   "ParNum" gives the actual number of snow model parameters.  The default
            value is 25.
   "StateNum" gives the number of snow model states.  The default value
              is 19.
    This is optional. Every input deck may have at most one this tag.
    Example:
        <snowModelInfo name="SNOW17" GridNum="25" ParNum="25" StateNum="19"/>
12.The <frzModelInfo> </frzModelInfo> item specifies the frozen ground model.
   It has three attributes, "name", "GridNum", "ParNum" and "StateNum".
   "name" gives the name of the snow model. Currently, only one frozen ground
   model is supported by HLRMS. That is "FRZ".
   The default is "FRZ".
   "GridNum" gives the number of grids that will be used to define actual model
             parameters.  The default value is 5.
   "ParNum" gives the actual number of frozen ground model parameters.
            The default value is 14.
   "StateNum" gives the number of frozen ground  model states.  The default
              value is 10.
    This is optional. Every input deck may have at most one this tag.
13. The <window> </window> item specifies a simulation domain in latitude and
    longitude. There are four items, left, right, top and bottom,
    conresponding to left boundary longitude, right boundary longitude, top
    boundary latitude and bottom latitude.
    This item is optional. However, if there is no sequential file, this item
    must present. That is simulation without routing.
    Example:
        <window> <left> 100.648 </left>
                 <right>100.507</right>
                 <top>34.9101</top>
                 <bottom> 34.8106</bottom>
        </window>
14. The <subWindow> </subWindow> item specifies sub windows inside the domain
    specified in the <window></window> item.
    This item is optional and can be used to generate sub-area averages of
    states/variables. Number of this item can be arbitrary. Subwindows
    defined by this item must be inside the domain defined by the
    <window></window> item.
    Each subwindow has a <RegionId></RegionId> and a <window></window> item.
    Example:
        <subWindow>
                <RegionId>RegionA</RegionId>
                <window>
                    <left> 100.61 </left>
                    <right>100.538</right>
                    <top>34.885</top>
                    <bottom> 34.8356</bottom>
                </window>
        </subWindow>
        <subWindow>
                <RegionId>RegionB</RegionId>
                <window>
                    <left> 100.31 </left>
                    <right>100.238</right>
                    <top>34.885</top>
                    <bottom> 34.8356</bottom>
                </window>
        </subWindow>
15. The <BasinInfo> </BasinInfo> item specifies outlet IDs from the sequential
    file and multiplication factors for model parameters and states.
    Multiplication factors could be positive or negative. Positive value means
    replacement of grid value (parameter or state), and negative means
    multiplication of grid value by the absolute value of this factor.  Basin
    selection depends on needs of output hydrograph or scaling states or
    parameters for selected sub-basin.
    This item is not optional. There should be at least one this item in an
    input deck.
    If the basin ID in the first <BasinInfo></BasinInfo> item is
    "-999", it means that do runoff simulation without routing on a given
    domain defined by the <window></window> item. The rest
    <BasinInfo></BasinInfo> items are ignored.
    Every instance of this item must have a <outletId></outletId> item to
    give the basin ID.
    It also may contain the following items:
     1)IPRF ---  runoff model parameters
     2)ISRF ---  runoff model states
     3)IPRT ---  routing model parameters
     4)ISRT ---  routing model states
     5)IPSN ---  snow model parameters
     6)ISSN ---  snow model states
     7)IPFZ ---  frozen ground model parameters
     8)ISFZ ---  frozen model states
     9)IPE ---  monthly PE
     10)IPEA ---  monthly PE adjustment
     11)PXADJ ---  precipitation adjustment factor
     12)IUH ---  unit hydrograph for this basin
     13)IPRG --- generate routing parameters only. If this item presents,
                 the routing parameter specified in this item will be
                 generated and the program stops without any simulations.
    Each item of 1) to 10) has a name item and a value item. The <name></name>
    item gives the name of the parameter or state. The <value></value> item
    gives the value of that parameter or state.
    Itmes listed above are optional. Each instance of <BasinInfo></BasinInfo>
    item can have arbitrary number of these items in any order.
    Example:
        <BasinInfo>
                <outletId>TEST4</outletId>
                <IPRF> <name>UZTWM</name> <value>-1.0</value> </IPRF>
                <IPRF> <name>UZFWM</name> <value>-1.0</value> </IPRF>
                <IPRF> <name>UZK</name> <value>-1.0</value> </IPRF>
                <IPRF> <name>PCTIM</name> <value>0.001</value> </IPRF>
                <IPRF> <name>ADIMP</name> <value>0.0</value> </IPRF>
                <IPRF> <name>RIVA</name> <value>0.001</value> </IPRF>
                <IPRF> <name>ZPERC</name> <value>-1.0</value> </IPRF>
                <IPRF> <name>REXP</name> <value>-1.0</value> </IPRF>
                <IPRF> <name>LZTWM</name> <value>-1.0</value> </IPRF>
                <IPRF> <name>LZFSM</name> <value>-3.0</value> </IPRF>
                <IPRF> <name>LZFPM</name> <value>-1.0</value> </IPRF>
                <IPRF> <name>LZSK</name> <value>-1.0</value> </IPRF>
                <IPRF> <name>LZPK</name> <value>-1.0</value> </IPRF>
                <IPRF> <name>PFREE</name> <value>-1.0</value> </IPRF>
                <IPRF> <name>SIDE</name> <value>0.0</value> </IPRF>
                <IPRF> <name>RSERV</name> <value>0.3</value> </IPRF>
                <IPRT> <name>SLOPC</name> <value>-1.0</value> </IPRT>
                <IPRT> <name>ROUGC</name> <value>-1.0</value> </IPRT>
                <IPRT> <name>BETAC</name> <value>-1.0</value> </IPRT>
                <IPRT> <name>ALPHC</name> <value>-1.0</value> </IPRT>
                <IPRT> <name>SLOPH</name> <value>-1.0</value> </IPRT>
                <IPRT> <name>DS</name> <value>-1.0</value> </IPRT>
                <IPRT> <name>ROUGH</name> <value>-1.0</value> </IPRT>
                <IPRT> <name>Q0CHN</name> <value>-0.8</value> </IPRT>
                <IPRT> <name>QMCHN</name> <value>-0.98</value> </IPRT>
                <ISRF> <name>uztwc</name> <value>0.75</value> </ISRF>
                <ISRF> <name>uzfwc</name> <value>0.14</value> </ISRF>
                <ISRF> <name>lztwc</name> <value>0.56</value> </ISRF>
                <ISRF> <name>lzfsc</name> <value>0.11</value> </ISRF>
                <ISRF> <name>lzfpc</name> <value>0.46</value> </ISRF>
                <ISRF> <name>adimpc</name> <value>1.0</value> </ISRF>
                <ISRT> <name>areac</name> <value>5.0</value> </ISRT>
                <ISRT> <name>depth</name> <value>0.0</value> </ISRT>
                <IUH>1.5</IUH>
                <IUH>4.5</IUH>
                <IUH>9.5</IUH>
                <IUH>15.5</IUH>
                <IUH>12.0</IUH>
                <IUH>6.5</IUH>
                <IUH>2.0</IUH>
                <PXADJ>2.5</PXADJ>
                <IPRG> 4 </IPRG>      <!-- 4 IPRGs -->
                <IPRG> 8 </IPRG>      <!-- the 8th parameters -->
                <IPRG> 0.195 </IPRG>  <!-- the first value -->
                <IPRG> 1.263 </IPRG>  <!-- the second value -->
        </BasinInfo>
B. The Document Type Defination (DTD)
   The input deck DTD are defined in the file InputDeck.dtd.
C. About XML
  1. Everything between <!-- and  --> is a comment
  2. In fact, every XML should include a header in the beginning - the XML
     declaration - defines the XML version and the character encoding used in
     the document.
     For example,
        <?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
     In this case the document confirms to the 1.0 specification of XML and
     uses the ISO-8859-1 (Latin-1/West European) character set.
  3. The DTD file, InputDeck.dtd, for input deck can be include using the
     following XML command:
    <!DOCTYPE XRTInputDeck SYSTEM "InputDeck.dtd">