15
                                                                                           

A MATLAB Implementation of TOPMODEL

  • Upload
    joseapb

  • View
    22

  • Download
    0

Embed Size (px)

DESCRIPTION

an article useful to compute TOPMODEL in a matlab language

Citation preview

  • A MATLAB IMPLEMENTATION OF TOPMODEL

    RENATA ROMANOWICZ

    Westlakes Research Institute, Moor Row, Cumbria, CA2U 3LN, UK

    ABSTRACT

    The MATLAB SIMULINK programming language is applied to the TOPMODEL rainfallruno model. SIMULINKrequires a good recognition of model dynamics, which has been achieved here in a version based on the firstTOPMODEL (Beven and Kirkby, 1979). Introducing the topographic index distribution in a vector form allows thegeneralization and simplification of the SIMULINK structure. The SIMULINK version of TOPMODEL has a very easyto understand graphical representation, which shows, in a straightforward way, all the physical interactions that takeplace in the model. Moreover, owing to its modular structure it is easy to add new and/or develop old submodels,depending on the available data and the goal of the modelling. In the example given here TOPMODEL was extended bytwo submodels representing the soil moisture and evaporation distribution in the catchment. Preparation of the data andpresentation of the results is done in MATLAB. Discharge predictions and spatial patterns of hydrological response aredemonstrated for a separate validation period. # 1997 by John Wiley & Sons, Ltd.

    Hydrol. Process., Vol. 11, 11151129 (1997).

    (No. of Figures: 9 No. of Tables: 2 No. of Refs: 16)

    KEY WORDS TOPMODEL; MATLAB SIMULINK; rainfallruno modelling; soil moisture modelling; spatialpredictions

    DESCRIPTION OF HYDROLOGICAL MODEL

    The model used in this study is a simplified version of the semi-distributed model TOPMODEL (Beven andKirkby, 1979; Beven, 1984, 1986; Romanowicz et al., 1993, 1994; Beven et al., 1995). It requires digitizedelevation data and a sequence of rainfall and potential evapotranspiration data, and predicts the resultingstream discharges.In TOPMODEL the predicted hydrological responses depend upon the distribution of an index of

    hydrological similarity lna=tan b (see Beven, 1997). This is derived from an analysis of the topography, asdescribed by the digital elevation data of the particular catchment being studied. Simple steady-state theoryis used to develop a relationship between the topographic index and the local saturation of the soil as thecatchment wets and dries. This relationship can be used to predict runo contributing areas in a non-linearway. The model also describes the subsurface drainage to the stream (Beven et al., 1995) through:

    Qbt T0 e l e St=m 1whereQb(t) is the subsurface drainage, T0 is the average eective transmissivity of the soil when the profile isjust saturated, l 1=A R li dA is the catchment average of the topographic index li lnai=tan bi, wherei represents the discrete increment of l, ai is the area of the hillslope per unit contour length that drainsthrough the location corresponding to this value of topographic index, and tan bi is the local surface slope.St is the catchment average storage deficit and m is a parameter that can be derived from an analysis of therecession curves for the catchment when it can be assumed that all the flow is derived from subsurface

    CCC 08856087/97/09111515$17.50 Received 20 June 1996# 1997 by John Wiley & Sons, Ltd. Accepted 6 December 1996

    HYDROLOGICAL PROCESSES, VOL. 11, 11151129 (1997)

    Contract grant sponsor: NERC.Contract grant number: GST/02/491.

  • drainage. Equation (1) can be inverted, given an initial flow at the start of the prediction, to give an initialvalue of storage deficit St0. Then, St is updated at each time step by a mass balance calculation involvingvertical recharge to the unsaturated zone and the subsurface drainage Qbt.The parameterm also enters as a scaling parameter in the calculation of the runo production areas in the

    catchment, through the relationship:

    DSi Si St ml li 2where DSi is the dierence between local and catchment average storage deficits, and li is the local value ofthe topographic index. Equation (2) assumes that the eective transmissivity at soil saturation ishomogeneous in the catchment. Surface runo contributing areas are predicted in locations where the localstorage deficit is zero. This occurs first at points with high values of li, and as the catchment wets up thecontributing area will spread to lower values of the index. The index can be calculated using digital terrainmaps of a catchment (Quinn et al., 1991, 1995).In the simplest version of the hydrological model, Equations (1) and (2) represent the most important

    functions in the model, with parametersm and T0. Under relatively wet conditions TOPMODEL has provento be generally successful in predicting stream discharges in catchments of relatively shallow soils andmoderate to steep slopes (see Beven et al., 1995; Beven, 1997). As reported in the literature, TOPMODEL ismost sensitive to the changes in the recession parameter m, while the transmissivity is influencing theresulting eciencies in a limited way, i.e. it should be bigger than some threshold value, depending on theconditions in the catchment.

    SIMULINK TOPMODEL STRUCTURE

    For the purpose of the SIMULINK implementation, an extension of the dynamic structure of TOPMODELpresented in the work of Beven and Kirkby (1979) seemed to be the most suitable. According to this workTOPMODEL consists of three basic dynamic components:

    (a) Root zone storage, S1, with maximum storage, SRmax, which must be filled, before infiltration,Q, fromit can take place. Evaporation is allowed at the potential rate until the store is empty. When this zone issaturated, it contributes to the surface runo. This formulation of root zone storage does not allow anyinteraction with saturated storage to take place and was changed as described in the following section.However, in the new formulation the concept of the root zone storagewasmaintained and therefore it is left inthis description.

    (b) A gravity drainage store S2, with a constant through time increment leakage rate Qv SAiQvi, to thethird non-linear storage S3 in the area which is not saturated (Ai denotes contributing area weighted by thetopographic index distribution). It is assumed that the rain falling on the saturated contributing area, Ac, willimmediately become overland flow. Also, any area that saturates during the time step owing to rainfallevaporation conditions in the catchment provides some overland flow. Evaporation from the store S2 isassumed at the potential rate.

    (c) A non-linear saturated subsurface storage with storage deficit S3t St and subsurface drainage Qbdefined by Equation (1) followed by the steady-state distribution of soil moisture deficits in the catchmentaccording to the topographic index distribution [Equation (2)].

    The scheme of those three storages and their interconnection can be presented as shown in Figure 1. Thedynamics of these three conceptual stores are described by the set of the ordinary non-linear dierentialequations. Now, taking the TOPMODEL scheme given in Figure 1 as a basis, the complete SIMULINKTOPMODEL structure is built, as shown in Figure 2.SIMULINK is a program for simulating dynamic systems (MathWorks Inc., 1992). It uses block diagram

    windows, where models are created, and edited, principally by mouse driven commands. The icons on the

    HYDROLOGICAL PROCESSES, VOL. 11, 11151129 (1997) # 1997 by John Wiley & Sons, Ltd.

    1116 R. ROMANOWICZ

  • SIMULINK window shown on Figure 2 represent SIMULINK built-in routines used to perform dierentoperations, such as vector or scalar summation (block sum), or block demux and mux, which are used torearrange vectors into subvectors. Icon yout allows writing the results of simulations into the MATLABworkspace. The same icon connected with the clock writes the corresponding time vector to the MATLABworkspace, thus allowing graphic display of the simulation results. The block called constant allows aconstant parameter to be set [here a vector MATB m lna=tan bbbbbbb] as one of the model input variables,while the block from workspace represents the vector of time-variable rainfall and evaporation data(data12) loaded into the MATLAB workspace. The standard SIMULINK operations and those built by theuser can be grouped together into subsystems, with inputs and outputs corresponding to their structure.Each subsystem can also contain other interconnected subsystems. The icons root, vector, ro ,gravity zone and saturation zone represent such complex subsystems. All those icons are shown inFigure 2 to help the interested reader in building their own SIMULINKTOPMODEL model.The basic structure of SIMULINKTOPMODEL consists of three dynamic subsystems, corresponding

    to the subsystems from Figure 1. The root zone submodel corresponds to the first storage from the scheme,the gravity drainage zone submodel corresponds to the second storage and the saturated zone submodelcorresponds to the third storage. The module steady-state soil moisture deficit distribution is represented bythe submodel called vector. It evaluates the distribution of the soil moisture deficits in the catchment,according to the static relation of TOPMODEL [Equation (2)], which can be rewritten in the form:

    S3t S3t ml lllllll 3

    where S3t [ St in Equations (1) and (2)] denotes a scalar averaged catchment soil moisture deficit,evaluated in the third submodel, and the vector S3 S3;1;S3;2, . . . ,S3;n is the topography-dependent soilmoisture deficit changing with time according to S3t, where n denotes the number of discrete values of thetopographic distribution (here n 60), and lllllll is a vector representing the topographic index distribution. Inthe runo submodel the overland flow from the root zone and the gravity drainage zone are summed upaccording to the incremental areas of the topographic index distribution. As shown in Figure 1, both the rootzone and gravity drainage zone depend on the topographic index distribution through the soil moisturedeficit vector S3. Hence, those submodels are also represented in a vector form. This feedback is a simplifieddescription of the dependency of the upward and downward groundwater fluxes on the soil moisture deficit.The submodel dynamics were changed to some extent in comparison with the model presented by Beven

    and Kirkby (1979), without changing the essential structure of the model. Explanations of the changes willbe given in the following sections, together with more detailed descriptions of SIMULINKTOPMODELsubsystems.

    Figure 1. Schematic representation of the semi-distributed catchment model TOPMODEL

    # 1997 by John Wiley & Sons, Ltd. HYDROLOGICAL PROCESSES, VOL. 11, 11151129 (1997)

    TOPMODEL 4: MATLAB IMPLEMENTATION 1117

  • Figure 2. SIMULINKTOPMODEL general scheme. Icons Demux and sum and clock represent SIMULINK operations. The other icons are user defined. The iconswith iconographic drawing represent complex subsystems

    Figure 3. SIMULINK scheme of root zone model, subsystem root from Figure 2. Icon Gain denotes multiplication by a constant. Icons time translation, vector productand matrix gain denote SIMULINK operations

    HYDROLOGICALPROCESSES,VOL.11,11151129(1997)

    #1997byJohnWiley

    &Sons,Ltd.

    1118

    R.ROMANOWICZ

  • Root zone model

    The search for a better description of the interrelations between the root zone and the unsaturatedsaturated zone in the catchment, without introduction of many new parameters, resulted in a submodelbased on the simple water balance relation in vector form (corresponding to the introduced vectorrepresentation):

    LRZyyyyyyyt 1 LRZyyyyyyyt Pt Ep Qyyyyyyyt;Zt 4where P(t) denotes the rainfall; Ep the potential evaporation; yyyyyyyt the vector of soil moisture content,averaged over the root zone depth; LRZ is the depth of the root; zone and Z(t) denotes the vector ofgroundwater levels, defined below the root zone depth, which we assume is linearly related to the soilmoisture deficit as:

    St Zt Dy0where Dy0 is some volumetric moisture deficit formed by rapid drainage assumed constant with depth(Beven, 1986).In this description it is assumed that the root zone has a constant soil moisture with depth. Upward or

    downward flux in the unsaturated zone is treated as a steady recharge or capillary rise. It is conditioned onthe boundary conditions of the root zone moisture content and the depth of the groundwater table.The recharge or capillary rise, Qyyyyyyyt;Zt, depends on the moisture content in the root zone and the

    groundwater level, which both depend on the soiltopographic index. For the sake of simplicity, itsderivation will be explained using the scalar notation. This relation is obtained on the basis of a Darciananalysis of steady recharge from above or below (an assumption consistent with the TOPMODEL assump-tions, see Beven et al., 1995), such that:

    Q Kh @h@z 1

    5

    where h denotes the moisture pressure head, z is the vertical coordinate and K(h) is the vertical conductivityin the unsaturated zone. The further assumption is made that the relation between vertical conductivity andmoisture pressure head is exponential, corresponding to the so-called Gardner model (Gardner, 1958):

    Kh Ks expa1h 6In order to get the relation between soil moisture and conductivity, we shall implement a generalizedGardner model (Romanowicz et al., 1995), which allows for a non-linear diusivitymoisture relation andgives a non-linear conductivitysoil moisture relation of the form:

    Ky K s yys

    a27

    where a1, from Equation (6), and a2 are coecients depending on soil properties.Combining Equations (47) and introducing the time index t and vector notation, the following relation

    for the flux from the root zone to the saturated zone, or vice versa, is obtained:

    Qyyyyyyyt;Zt K syyyyyyytys

    a2expa1Zt1 expa1Zt 8

    This relation depends on the saturated conductivity K s, soil moisture content in the root zone yyyyyyy, groundwaterlevel Z and soil porosity parameters a1 and a2. As the groundwater level is changing across the catchment

    # 1997 by John Wiley & Sons, Ltd. HYDROLOGICAL PROCESSES, VOL. 11, 11151129 (1997)

    TOPMODEL 4: MATLAB IMPLEMENTATION 1119

  • according to the soiltopographic index, the vertical flux and root zone water content will also change. Theinitial moisture content in the root zone is estimated from the initial average storage deficit as determinedfrom the inversion of Equation (1).In the original formulation of TOPMODEL the root zone represents a soil water storage reflecting the

    field capacity concept (Beven et al., 1995). Flow into gravity storage, i.e. unsaturated and saturatedstorages, occurs only when field capacity is satisfied. In the present formulation steady capillary rise ordownward flux from the root zone to the water table depends on the root zone moisture content and thewater table depth. When the root zone is full to field capacity, rainfall infiltrates into the gravity storage witha steady flux approaching K s for low water table depths [see Equation (9)], which is consistent with theoriginal TOPMODEL formulation. This case would be regarded in the literature as post-ponding infiltrationwith constant saturated soil moisture at the surface (Philip, 1969). The present formulation diers from thatgiven by Wood et al. (1990), where, after ponding, infiltration proceeds with the rate determined from theconcentration boundary condition at the surface (Philip, 1969) and with the vertical flow formulations usedin recent versions of TOPMODEL (Beven et al., 1995). The main dierence between the present and originalformulation occurs for the intermediate cases, when the root zone water content is small and the water tableis close to the root zone and capillary rise takes place. Conductivity is assumed to change exponentially withpressure head according to the Gardner assumptions.The SIMULINK scheme for the root zone is presented in Figure 3. As mentioned above, in order to

    simplify and generalize the program structure, a vector representation of the topographic index is introduced.This description yields a state space representation of the root zone with a dimension equal to the dimensionof the discretized topographic index distribution (60 discrete values in the presented paper). The input to thesubmodel consists of the catchment average precipitation, evaporation and the local soil moisture deficits inthe catchment evaluated in the vector submodel. The submodel output consists of the vector of the resultingwater transfers from or to the unsaturated zone and runo from the contributing areas.

    Gravity drainage model

    A detailed scheme of the SIMULINK gravity drainage submodel is given in Figure 4. In this particularapplication the unsaturated zone has very simplified dynamics, as given by Equation (9). In the case whensome more detailed observations in the catchment are available it could be developed further without thedanger of overparameterization. The input to this submodel consists of the vector of soil moisture transfersfrom/to the root zone and the vector of soil moisture deficits evaluated in the vector submodel. Hence, thissubmodel has a vector form dependent on the topographic index. Its dynamics has the form:

    S2t 1 minfS3t;max0;S2t Qyyyyyyyt;Ztg 9

    where S2t denotes the vector of deficits of the unsaturated zone, which is not allowed to be bigger than thesoil moisture deficit for a given topographic index calculated from the third saturation zone submodel.Qyyyyyyyt;Zt denotes the vector of water flux from the root zone submodel given by Equation (8).Thus, the water transfer to the saturated zone in the vector notation is equal to:

    Qvt S2t 1 S2t Qyyyyyyyt;Zt 10

    As the saturated zone submodel is averaged over the catchment, the vector given by Equation (11) must alsobe averaged using the aerial weight associated with each discrete value of topographic index. The compo-nents of Qv can be positive or negative, depending on the conditions in the catchment.

    Saturated zone model

    The third storage is assumed to be non-linear with the exponential outflow, Qbt, given by the scalarexponential function of Equation (1). The change of catchment average saturation zone storage deficit S3t

    HYDROLOGICAL PROCESSES, VOL. 11, 11151129 (1997) # 1997 by John Wiley & Sons, Ltd.

    1120 R. ROMANOWICZ

  • Figure 4. SIMULINK scheme of gravity drainage submodel from Figure 2. Icon Mux denotes SIMULINK operation

    Figure 5. SIMULINK scheme of saturation zone submodel from Figure 2. Icon integrator represents SIMULINK operation

    #1997byJohnWiley

    &Sons,Ltd.

    HYDROLOGICALPROCESSES,VOL.11,11151129(1997)

    TOPMODEL4:MATLABIM

    PLEMENTATIO

    N1121

  • with time can be described by the following balance equation:

    d S3tdt Qbt Qvt 11

    whereQbt is the downslope flow andQvt SAiQvit is the total amount of water transferred between thecatchment surface and the saturated zone summed over the topographic index distribution aerial weights Ai,with Qv negative in the case of capillary rise. It is assumed that the outflow from this storage is non-linearand follows an exponential rule in a relation equivalent to Equation (1):

    Qbt Q0 exp S3t=m 12where Q0 T0 el is the flow when S3t 0 and is a constant for a catchment.The SIMULINK scheme of this submodel is given in Figure 5. Its input is the catchment average recharge

    from the unsaturated zone and its output is evaluated according to Equation (12). This submodel is one-dimensional and is the basic component of TOPMODEL described by Equations (2), (11) and (12). It uses acontinuous integrator with initial soil moisture deficit specified from an initial discharge in accordance withEquation (1). Both root zone and unsaturated zone submodels have discrete integrators representedby discrete state space modules. This is owing to the fact that when the scheme was built, continuousintegrators were not yet available in vector form within SIMULINK. A continuous integrator is usuallyrecommended for continuous problems and the user can easily change the scheme accordingly. Thosediscrete integrators have been left here to demonstrate the ability of the model to incorporate dierentsubmodel descriptions.The vector submodel conceptually belongs to the saturated zone model but was shown separately, mainly

    for the illustrative purpose of stressing the dierent use of the vector and scalar form of the soil moisturedeficits in this form of TOPMODEL.The root zone, gravity drainage zone and saturated zone submodels constitute the main body of

    TOPMODEL. Depending on the goal of the modelling and available data the user can further developTOPMODEL structure, adding new, or extending and developing existing, components. The next sectiondemonstrates the extension of the root zone model towards the estimation of the spatial patterns of soilmoisture and evaporation changes in the catchment. As there are no data available for the calibration ofparameters involved, the demonstration has a mainly illustrative purpose.

    Soil moisture and evaporation

    The vector of root zone soil moisture, as dependent on the topographic index can be used to produce atwo-dimensional graphical representation of the soil moisture and evaporation spatial distribution in acatchment, developed in MATLAB. It is assumed that the distribution of the moisture content over thecatchment is consistent with the distribution of the topographic index, i.e. the soil transmissivity is uniform.This assumption may be changed if there is some additional information available about the vegetation/soildistribution in the catchment. To relate the soil moisture at the surface to the initial recharge of theunsaturated zone, Equation (8) is used.The soil moisture content evaluated in the root zone can be related to the actual evaporation from the

    catchment Ea with the help of the relationship introduced by Philip (1957), who expressed the actualevapotranspiration in terms of relative soil moisture and atmospheric humidity:

    Eat Ep hpt ha1 ha 13

    where Ep denotes potential evaporation and ha and hp are relative atmospheric and soil humidity,respectively.

    HYDROLOGICAL PROCESSES, VOL. 11, 11151129 (1997) # 1997 by John Wiley & Sons, Ltd.

    1122 R. ROMANOWICZ

  • The relative soil humidity can be expressed in terms of the soil moisture potential using the thermo-dynamic equation under the assumptions of negligible temperature changes (see also OKane, 1992).Assuming some tractable model of the moisture characteristic curve (e.g. a generalized Gardner form, as inRomanowicz et al., 1995) the following formula can be derived:

    Eat Epexp nfe

    yyyyyyytys

    nfe=aha

    ( )1 ha 14

    where ha denotes the relative humidity of the air at the soil surface, Ep is the potential evaporation, fe isair entry soil moisture potential, ys is soil moisture at saturation, n is a thermodynamic constant(n 74 106 kg J1 at t 208C) and a a1=a2 depends on soil porosity; and yyyyyyyt denotes the vector ofsoil moisture content in the root zone, changing with time. Hence, Ea also has a vector form, depending onthe soiltopographic index and it is possible to map it back on to the topography using the spatialdistribution of that index (Figure 7). In other words, each cell of the grided catchment area has some

    Figure 6. Simulated and observed flow, validation period, January 1988, River Severn catchment at Plynlimon, UK

    # 1997 by John Wiley & Sons, Ltd. HYDROLOGICAL PROCESSES, VOL. 11, 11151129 (1997)

    TOPMODEL 4: MATLAB IMPLEMENTATION 1123

  • known topographic index value which corresponds, in turn, to the value of evaporation and soil moisturecontent. In this way both changes of soil moisture content and actual evapotranspiration distributionswith time can be represented graphically. Figures 8 and 9 show soil moisture distribution and evapo-transpiration for an area of mid-Wales at two dierent time steps during a storm event. In the numericalapplication presented, soil parameters were set to values typically met in the literature for loamyclay

    Figure 7. Topographic index distribution for the River Severn catchment at Plynlimon, UK. Stars on the map indicate the Severncatchment boundaries with an outlet at the right-hand corner. The picture scale corresponds to number of, x and y, 50-m grid pixels

    (6 km 8 km rectangle)

    HYDROLOGICAL PROCESSES, VOL. 11, 11151129 (1997) # 1997 by John Wiley & Sons, Ltd.

    1124 R. ROMANOWICZ

  • soils: a 037 104, fe 01 m, K s 0006 m h1, ha 0001. For those parameters the exponentfor the soil moisture in Equation (13) is equal to 0.2. Soil parameters used in this submodel, as well asin the root zone submodel, have been treated as average values over the catchment. As already men-tioned, the maps presented have only qualitative meaning owing to lack of observations for parametercalibration.

    Figure 8. Soil moisture distribution over the Severn catchment at Plynlimon, UK, at t 45 h of an event (validation period), January1988. Stars on the map indicate the Severn catchment boundaries with an outlet at the right-hand corner. The picture scale corresponds

    to number of, x and y, 50-m grid pixels (6 km 8 km rectangle)

    # 1997 by John Wiley & Sons, Ltd. HYDROLOGICAL PROCESSES, VOL. 11, 11151129 (1997)

    TOPMODEL 4: MATLAB IMPLEMENTATION 1125

  • PARAMETER CALIBRATION OF SIMULINKTOPMODEL WITHIN MATLAB

    The model was tested on the Institute of Hydrology experimental catchment on the River Severn atPlynlimon, mid-Wales, UK, which forms part of the 8 6 km2 area shown in Figures 79. It is a small,predominantly forested catchment of area 8.7 km2 with continuous hourly flow and rainfall data. The

    Figure 9. Evaporation distribution over the Severn catchment at Plynlimon, UK, at t 45 h of an event, January 1988. Stars onthe map indicate the Severn catchment boundaries with an outlet at the right-hand corner. The picture scale corresponds to number of,

    x and y, 50-m grid pixels (6 km 8 km rectangle)

    HYDROLOGICAL PROCESSES, VOL. 11, 11151129 (1997) # 1997 by John Wiley & Sons, Ltd.

    1126 R. ROMANOWICZ

  • required data are the same as for the FORTRAN version of TOPMODEL. They consist of rainfall,evaporation and flow data, as well as a topographic index distribution obtained from the elevation data. Theavailable DTM has 50 m resolution and contains also the adjacent Wye experimental catchment. The timedata consist of hourly discharges and rainfall series for the years 1986 and 1988. The hourly potentialevapotranspiration is estimated from meteorological measurements using the PenmanMonteith formula.In this application the model is used to simulate hourly flows using hourly rainfall inputs.The parameters of the model may be set on the basis of any suitable calibration method outside the

    MATLAB software. However, it is convenient to calibrate the parameters of SIMULINKTOPMODELusing the optimization routines within the MATLAB workframe. The multivariable optimization routine inMATLAB uses the non-gradient NelderMeade simplex search described in Dennis and Woods (1987). TheSIMULINKTOPMODEL system has the form of an M-file in MATLAB and constitutes a set ofdierential equations that are integrated at each call of the optimization routine. The choice of method ofintegration is the same as in the SIMULINK Menu (e.g. RungeKutta 3rd and 5th order, Gear, Adams orEuler). In the presented application an Adams/Gear method of integration was chosen. The results of thesimulations are used to evaluate some performance measure specified by the user that is directly used in theoptimization procedure. The results of the subsequent runs of TOPMODEL (e.g. time trajectory ofsimulated and observed flows) can be displayed on-line within the MATLAB graphical window, togetherwith the corresponding parameter values obtained during the optimization procedure. To ensure propercommunication between dierent MATLAB subroutines all the parameters that undergo changes because ofthe optimization procedure should be declared as global in the MATLAB workspace.As can be easily guessed, the MATLAB calibration procedure will take more computer time than a

    corresponding FORTRAN procedure. However, it might be very useful when experimenting with the modelstructure. Also, it can save programming time when more complicated, non-linear dierential equationstructures are considered, since the integrators are robust and quick and do not require any programmingeort. In the corresponding FORTRAN program ordinary dierential equations are replaced by dierenceequations with a time step dictated by the discretization of input data. In SIMULINK, integrator algorithmscan use a variable time step controlled by the required accuracy of the solution.Four examples of the results of the MATLAB-based joint calibration routine of the recession parameterm

    and root zone layer depth LRZ, for dierent starting points of parameters and dierent length of timehorizon, are given in Table I. The other model parameters are given in Table II. From previous numericalexperiments performed on this catchment (Romanowicz et al., 1993) it was known that the transmissivityparameter does not influence the simulated flow when its value is bigger than some threshold value (hereT0 103 m2 h1). Therefore, this parameter was not included in the optimization.The time horizons of simulations were 200, 400 and 500 hours long. The sum of square dierences between

    the simulated and observed flows was taken as the objective function. The time of computation of a single

    Table I. Optimization results for dierent starting points and dierent time horizons in two-dimensional parameter space

    mstart LRZstart mfinal LRZfinal Time horizon (h) NI

    0.02 0.1 0.0098 0.2188 200 620.01 0.1 0.0137 0.1298 400 630.02 0.2 0.0137 0.1291 400 800.03 0.3 0.0133 0.1292 500 108

    Table II. TOPMODEL parameters used in the validation experiment shown in Figure 6

    m (m) LRZ (m) T0 m2 h1 K s m=h1 a ys ha fe m0.0098 0.2188 103 0.006 037 104 0.42 0.001 0.1

    # 1997 by John Wiley & Sons, Ltd. HYDROLOGICAL PROCESSES, VOL. 11, 11151129 (1997)

    TOPMODEL 4: MATLAB IMPLEMENTATION 1127

  • simulation was about 20 s on a SUN 10 workstation. A single parameter optimization needs about22 simulations (objective function evaluations) for a 200 hours time horizon. Parameter NI in Table Idenotes the number of simulations needed to obtain some precision of the optimization (minimum value ofthe objective function) specified by the user. When starting from dierent initial parameter values dierentnumbers of simulations are required to obtain the same goodness-of-fit measure of the model performance.The number of simulations required will also be dierent for dierent sets of inflow data. As the time ofcomputation of a single simulation increases with the increase of the length of time horizon, so the optim-ization time will increase. Because of the use of non-gradient optimization procedures, time of computationsincreases rapidly with the increase in the number of calibrated variables and will depend on how far thestarting point is from the best estimate. Hence, because of long times of computations, this software is notrecommended for a multiple search through the entire parameter region for long (thousands of hours) timeperiods. It can be useful in the case when it is expected that owing to changes in the model structure,parameters should change slightly, or when we want to set the initial values for the parameters that wouldgive reasonable results for short time periods. MATLAB graphical facilities allow the display of the results ofsimulations for each change of parameter set, which might also help in model analysis.

    THE RESULTS OF SIMULATIONS

    The model parameters m, and LRZ were optimized using the MATLAB non-gradient optimization routinedescribed above. Sensitivity analysis of the results has shown that the depth of the root zone influences theresults in a most pronounced way. Soil parameters as used in the model are treated as averaged over thecatchment. From the results presented in Table I it can be seen that the value of optimal parameters dependon the length of the time horizon of simulations and the initial parameter values. Hence, running theoptimization procedure for the longest possible time horizons for several dierent starting points isrecommended. To minimize the time of computations of a single run of the model, and for clarity of theSIMULINK scheme, all the preparations of data needed by the program, such as initial value of the soilmoisture deficit and the catchment average topographic index, were done in a MATLAB program that is runbefore the SIMULINK program. When the optimization facilities are used this program is incorporated intothe optimization procedures in MATLAB. SIMULINK graphical facilities allow on-line observation of anyvariables in the model during the simulation process. The results of simulations can also be presented usingthe MATLAB graphical facilities after the simulations are finished. Figure 6 presents the simulated andobserved outflow hydrographs for a separate validation period with parameters given in Table II.The changes of the soil moisture content for dierent values of topographic index can be mapped back on

    to the space, thus allowing a two-dimensional (or three-dimensional when over imposed on the topographymap) graphical representation of the spatial changes of those variables in the catchment as shown inFigures 78. MATLAB allows time and space changes to be shown together, in the form of video imagesthat can be presented on the computer screen.

    CONCLUSIONS

    This paper has described a SIMULINK version of TOPMODEL, and its use together with a MATLABparameter calibration routine. These included:

    1. A state space representation of TOPMODEL.2. The vector representation of the topographic index distribution.3. The scheme of the main SIMULINKTOPMODEL structure and the schemes of the submodels.4. The graphical presentation of the results.5. Parameter calibration using the MATLAB optimization routines.

    It is worth noting that SIMULINK forces the modeller to use the language of systems analysis. Itencourages a deeper understanding of the model used and clear division of the physical system into the

    HYDROLOGICAL PROCESSES, VOL. 11, 11151129 (1997) # 1997 by John Wiley & Sons, Ltd.

    1128 R. ROMANOWICZ

  • interacting subsystems. Its structure clearly demonstrates the simplifications used in the representation of thephysical process and the mutual interdependence of the subprocesses. It also allows more complicateddescriptions of the subprocesses to be used, while the main structure of the model is still unchanged. Forexample, we can easily imagine introducing a more precise description of the evapotranspiration process orgravity drainage zone, when more observations are available. Also, in the case when contaminant data arepresent, another submodel describing transport in the catchment could be added. Also, model parameterscan be easily adjusted by the user while comparing the simulation results with the expected ones orobservations. The possibility of using the MATLAB powerful non-gradient optimization routines allows fora more precise choice of any parameters, without the need of building the equivalent FORTRAN program.The main advantages of the SIMULINKTOPMODEL lie in its very illustrative and easy to follow

    system structure, which makes evident the direction of data flows in the modelled process. This systemstructure gives the possibility of further investigation and development of its subsystems using the MATLABgraphical tools, including the easy presentation of spatially distributed predictions either during a simulationrun as an animation, or later as o-line evaluation of the results. This form of visual presentation isparticularly useful in assessing and comparing the performance of distributed models, relative to theexpectations of the observed catchment behaviour.

    ACKNOWLEDGEMENTS

    I would like to thank Keith Beven for his encouragement and help in developing the root zone submodel andWlodek Tych (both from Environmental Sciences Division, Lancaster University), for introducing me toMATLABSIMULINK. Data used in the numerical examples given were taken from research done by theauthor as part of NERC grant GST/02/491.

    REFERENCES

    Beven, K. 1984. Infiltration into a class of vertically non uniform soils, Hydrol. Sci. J., 29, 425434.Beven, K. J. 1986. Runo production and flood frequency in catchment of order n: an alternative approach, in Rodriguez-Iturbe, I.and Wood, E. F. (Eds), Scale Problems in Hydrology. Reidel, Dordrecht. pp. 107131.

    Beven, K. J., 1997. TOPMODEL: a critique, Hydrol. Process., 11, 10691085.Beven, K. and Kirkby, M. J. 1979. A physically based variable contributing area model of basin hydrology, Hydrol. Sci. Bull., 24,4369.

    Beven, K. J., Lamb, R., Quinn, P., Romanowicz, R. and Freer, J. 1995. TOPMODEL, in Sing, V. P. (Ed.), Computer Models ofWatershed Hydrology. Water Resource Publications, Colorado. pp. 627668.

    Dennis, J. E. and Woods, D. J. 1987. New Computing Environments: Microcomputers in Large-Scale Computing, Wouk, A. (Ed.).Society for Industrial and Applied Mathematics, Philadelphia, Pa. pp. 116122.

    Gardner, W. R. 1958. Some steady state solutions of the unsaturated moisture flow equation with application to evaporation from awater table, Soil Sci., 85, 228232.

    MathWorks Inc. 1992. SIMULINK Dynamic System Simulation Software, User Guide, MathWorks Inc., Mass., US.OKane, P. J. 1992. The hydrology of milled peat production, in OKane, J. P. (Ed.), Advances in Theoretical Hydrology A Tributeto James Dooge. European Geophysical Society Series on Hydrological Sciences, Vol. 1. Elsevier, Amsterdam.

    Philip, J. R. 1957. Evaporation and moisture and heat fields in soil, J. Meteorol., 14, 354366.Philip, J. R. 1969. Theory of infiltration, Adv. Hydrosci., 5, 215296.Quinn, P. F., Beven, K., Chevallier, P., and Planchon, O. 1991. The prediction of hillslope flow paths for distributed hydrologicalmodelling using digital terrain models, Hydrol. Process., 5, 5979.

    Quinn, P. F., Beven, K. J., and Lamb, R. 1995. The la=tan b index: how to calculate it and how to use it within the TOPMODELframework, Hydrol. Process., 9, 161182.

    Romanowicz, R., Beven, K., Freer, J., and Moore, R. 1993. TOPMODEL as an application module within WIS, in Kovar, K. andNachtnebel, H. P. (Eds), Proceedings of the International Conference on Application of Geographic Information Systems in Hydrologyand Water Resources, HydroGIS93, IAHS Publ. No 211. IAHS, Wallingford. pp. 211233.

    Romanowicz, R., Beven, K. and Moore, R. 1994. GIS and distributed hydrologic models, in Mather, P. M. (Ed.), GeographicalInformation Handling Research and Applications. Wiley, Chichester. pp. 197205.

    Romanowicz, R. J., Dooge, J. C. I., and OKane, J. P. 1995. Spatial variability of evaporation from the land surface random initialconditions, in Kundzewicz, Z. (Ed.), New Uncertainty Concepts in Hydrology and Water Resources. Cambridge University Press,Cambridge. pp. 197205.

    Wood, E. F., Sivapalan, M., and Beven, K. J. 1990. Similarity and scale in catchment storm response, Rev. Geophys., 28, 118.

    # 1997 by John Wiley & Sons, Ltd. HYDROLOGICAL PROCESSES, VOL. 11, 11151129 (1997)

    TOPMODEL 4: MATLAB IMPLEMENTATION 1129