You are on page 1of 100

SWATCUP

SWATCalibrationandUncertaintyPrograms

KarimC.Abbaspour
abbaspour@eawag.ch

SWATCUP:SWATCalibrationandUncertaintyProgramsAUserManual.

Eawag2015

DISCLAIMER

ThisreportdocumentsSWATCUP,acomputerprogramforcalibrationofSWATmodels.SWATCUP4is
a public domain program, and as such may be used and copied freely. The program links SUFI2, PSO,
GLUE, ParaSol, and MCMC procedures to SWAT. It enables sensitivity analysis, calibration, validation,
anduncertaintyanalysisofSWATmodels.SWATCUP2012hasbeentestedforallprocedurespriorto
release. However, no warranty is given that the program is completely errorfree. If you encounter
problemswiththecode,finderrors,orhavesuggestionsforimprovement,pleasewritetoSWATCUP
Googlegroupatswatcup@googlegroups.com

Content

Page

Foodforthoughtincalibrationandapplicationofwatershedmodels
SUFI2

6
16

ConceptualbasisoftheSUFI2uncertaintyanalysisroutine

17

SUFI2asanoptimizationalgorithm

19

SWATCUP

20

StepbystepCreatingofSWATSUFI2InputFiles

21

ParameterizationinSWATCUP

51

Objectivefunctiondefinition

55

Sensitivityanalysis

59

ParallelProcessing

63

ValidationinSUFI2

64

Thesequenceofprogramexecution

65

Howto..

66

PSO
IntroductiontoPSO

70
71

GLUE

74

IntroductiontoGLUE

75

CouplingGLUEtoSWATCUP

77

ValidationofGLUE

78

FileDefinition

79

ParaSol

81

IntroductiontoParaSol

82

CouplingParaSoltoSWATCUP

83

ParaSol:Optimizationanduncertaintyanalysis

85

MCMC

92

IntroductiontoMCMC

93

StepbysteprunningofMCMC

96

References

98

Foodforthoughtincalibrationandapplicationofwatershedmodels
Calibrationanduncertaintyanalysisofdistributedwatershedmodelsisbesetwithafewseriousissues
thatdeservetheattentionandcarefulconsiderationofresearchers.Theseare:1)Parameterizationof
watershedmodels.2)Definitionofwhatisacalibratedwatershedmodelandwhatarethelimitsofits
use. 3) Conditionality of a calibrated watershed model. 4) Calibration of highly managed watersheds
wherenaturalprocessesplayasecondaryrole,and5)uncertaintyandnonuniquenessproblems.These
issuesarebrieflydiscussedhere.

1)ModelParameterization
Shouldasoilunitappearinginvariouslocationsinawatershed,underdifferentlandusesand/orclimate
zones,havethesameordifferentparameters?Probablyitshouldhavedifferentparameters.Thesame
argument could be made with all other distributed parameters. How far should one go with this
differentiation?Ontheonehandwecouldhavethousandsofparameterstocalibrate,andonotherwe
maynothaveenoughspatialresolutioninthemodeltoseethedifferencebetweendifferentregions.
This balance is not easy to determine and the choice of parameterization will affect the calibration
results. Detailed information on spatial parameters is indispensable for building a correct watershed
model. A combination of measured data and spatial analysis techniques using pedotransfer functions,
geostatisticalanalysis,andremotesensingdatawouldbethewayforward.

2)Whenisawatershedmodelcalibrated?
Ifawatershedmodeliscalibratedusingdischargedataatthewatershedoutlet,canthemodelbecalled
calibrated for that watershed? If we add water quality to the data and recalibrate, the hydrologic
parameters obtained based on discharge alone will change. Is the new model now calibrated for that
watershed?Whatifweadddischargedatafromstationsinsidethewatershed?Willthenewmodelgive
correctloadsfromvariouslandusesinthewatershed?Perhapsnot,unlessweincludetheloadsinthe
calibrationprocess(seeAbbaspouret al.,2007).Hence,animportantquestionarisesasto:forwhat
purpose can we use a calibrated watershed model? For example: What are the requirements of a
calibratedwatershedmodelifwewanttodolandusechangeanalysis?Or,climatechangeanalysis?Or,
analysis of upstream/downstream relations in water allocation and distribution? Can any single
calibrated watershed model address all these issues? Can we have several calibrated models for the
same watershed where each model is applicable to a certain objective? Note that these models will
mostlikelyhavedifferentparametersrepresentingdifferentprocesses(seeAbbaspouretal.1999).

3)Conditionalityofcalibratedwatershedmodels
Conditionalityisanimportantissuewithcalibratedmodels.Thisisrelatedtothepreviousquestionon
thelimitationontheuseofacalibratedmodel.Calibratedparametersareconditionedonthechoiceof
objectivefunction,thetype,andnumbersofdatapointsandtheprocedureusedforcalibration,among
otherfactors.Ina previousstudy(Abbaspouretal.1999),weinvestigated the consequencesof using
different variables and combination of variables from among pressure head, water content, and
cumulativeoutflowontheestimation ofhydraulic parametersbyinversemodeling.Theinversestudy

combined a global optimization procedure with a numerical solution of the onedimensional variably
saturated Richards flow equation. We analyzed multistep drainage experiments with controlled
boundary conditions in large lysimeters. Estimated hydraulic parameters based on different objective
functionswerealldifferentfromeachother;however,asignificanttestofsimulationresultsbasedon
these parameters revealed that most of the parameter sets produced similar simulation results.
Notwithstanding the significance test, ranking of the performances of the fitted parameters revealed
that they were highly conditional with respect to the variables used in the objective function and the
typeofobjectivefunctionitself.Mathematically,wecouldexpressacalibratedmodelMas:

M M ( p, g , w, b, v, m,....)
where isavectorofparameters,pisacalibrationprocedure,gistheobjectivefunctiontype,wisa
vectorofweightsintheobjectivefunction,bistheboundaryconditions,visthevariablesusedinthe
objectivefunction,misthenumberofobservedvs,etc.Therefore,acalibratedmodelisconditionedon
the procedure used for calibration, on the objective function, on the weights used in the objective
function,ontheinitialandboundaryconditions,onthetypeandlengthofmeasureddatausedinthe
calibration,etc.Suchamodelcanclearlynotbeappliedforjustanyscenarioanalysis.

4)Calibrationofhighlymanagedwatersheds
Inhighlymanagedwatersheds,naturalprocessesplayasecondaryrole.Ifdetailedmanagementdatais
notavailable,thenmodelingthesewatershedswillnotbepossible.Examplesofmanagementsaredams
andreservoirs,watertransfers,andirrigationfromdeepwells.InFigure1atheeffectofAswandamon
downstreamdischargebeforeandafteritsoperationisshown.Itisclearthatwithouttheknowledgeof
damsoperation,itwouldnotbepossibletomodeldownstreamprocesses.Figure1bshowstheeffect
ofwetlandondischargeupstream,inthemiddle,anddownstreamofNigerInlandDelta.

Figure1.left)EffectofAswandamondownstreamdischargebeforeandafteritsoperationin1967.
right)TheinfluenceofNigerInlandDeltaonthethroughflowatupstream,within,anddownstreamof
thewetland.(AfterSchuoletal.,2008a,b)

InFigure2theeffectofirrigationonactualETandsoilmoistureisillustratedinEsfahan,Iran.Esfahanis
aregionofhighirrigationwithanegativewaterbalanceforalmosthalfoftheyear.

20
10

Ju
n
Ju
l
A
ug
Se
p
O
ct
N
ov
D
ec

Ja
n
Fe
b
M
ar
A
pr
M
ay

ug
Se
p
O
ct
N
ov
D
ec

30

Ju
l

40

(b)

50

100
90
80
70
60
50
40
30
20
10
0
Ja
n
Fe
b
M
ar
A
pr
M
ay
Ju
n

(a)
Soil water (mm)

-1

Actual ET (mm month )

60

Month

Month

With irrigation

Without irrigation

Figure2.IllustrationofthedifferencesinpredictedactualET(a)andsoilmoisture(b)withandwithout
consideringirrigationinEsfahanprovince,Iran.Thevariablesaremonthlyaveragesfortheperiodof
19902002.(AfterFaramarzietal.,2009)

InthestudyofwaterresourcesinIran,Faramarzietal.,(2008)producedawatermanagementmap
(Figure3)inordertoexplainthecalibrationresultsofahydrologicmodelofthecountry.

Figure3.WatermanagementmapofIranshowingsomeofmansactivitiesduring19902002.Themap
showslocationsofdams,reservoir,watertransfersandgroundwaterharvest(backgroundshows
provincialbasedpopulation).AfterFaramarzietal.,(2009).

5)Uncertaintyissues
Anotherissuewithcalibrationofwatershedmodelsisthatofuncertaintyinthepredictions.Watershed
modelssufferfromlargemodeluncertainties.Thesecanbedividedinto:conceptualmodeluncertainty,
input uncertainty, and parameter uncertainty. The conceptual model uncertainty (or structural
uncertainty) could be of the following situations: a) Model uncertainties due to simplifications in the
conceptualmodel,b)Modeluncertaintiesduetoprocessesoccurringinthewatershedbutnotincluded
in the model, c) Model uncertainties due to processes that are included in the model, but their
occurrencesinthewatershedareunknowntothemodeler,andd)Modeluncertaintiesduetoprocesses
unknowntothemodelerandnotincludedinthemodeleither!
Inputuncertaintyisasaresultoferrorsininputdatasuchasrainfall,andmoreimportantly,extension
ofpointdatatolargeareasindistributedmodels.Parameteruncertaintyisusuallycausedasaresultof
inherentnonuniquenessofparametersininversemodeling.Parametersrepresentprocesses.Thefact
thatprocessescancompensateforeachothergivesrisetomanysetsofparametersthatproducethe
sameoutputsignal.Ashortexplanationofuncertaintyissuesisofferedbelow.

5.1)Conceptualmodeluncertainty
a)Modeluncertaintiesduetosimplificationsintheconceptualmodel.Forexample,theassumptionsin
the universal soil loss equation for estimating sediment loss, or the assumptions in calculating flow
velocityinariver.Figures4aand4bshowsomegraphicalillustrations.

Fig.4.(left)Asimplifiedconceptualmodelofhydrologyinawatershedwhererevapisignored.(right)A
naturalprocessnearthesourceofYellowRiverinChinaplayinghavocwithriverloadingbasedonthe
USLE!

b)Modeluncertaintiesduetoprocessesoccurringinthewatershedbutnotincludedinthemodel.For
example,winderosion(Fig.5left),erosionscausedbylandslides(Fig.5right),andthesecondstorm
effecteffectingthemobilizationofparticulatesfromsoilsurface(seeAbbaspouretal.,2007).


Figure5.Naturalprocessesnotincludedinmostwatershedmodelsbutwithalargeimpactonhydrology
andwaterqualityofawatershed,albeitforashortperiod

c) Model uncertainties due to processes that are included in the model, but their occurrences in the
watershed are unknown to the modeler or unaccountable; for example, various forms of reservoirs,
watertransfer,irrigation,orfarmmanagementaffectingwaterquality,etc.(Fig.6,7).

Fig.6.Agriculturalmanagementpracticessuchaswaterwithdrawalandanimalhusbandrycanaffect
waterquantityandquality.These,maynotalwaysbeknowntothemodeller.

10


Fig.7.Watercontrolandwaterdiversionsmaychangetheflowinwaysthatareunknowntothe
modellerand,hence,cannotbeaccountedforinthemodel.
d)Modeluncertaintiesduetoprocessesunknowntothemodelerandnotincludedinthemodeleither!
Theseincludedumpingofwastematerialandchemicalsintherivers,orprocessesthatmaylastfora
numberofyearsanddrasticallychangethehydrologyorwaterqualitysuchaslargescaleconstructions
of roads, dams, bridges, tunnels, etc. Figure 8 shows some situations that could add substantial
conceptualmodelerrortoouranalysis.

Fig.8Largeconstructionprojectssuchasroads,dams,tunnels,bridges,etc.canchangeriverflowand
waterqualityforanumberofyears.Thismaynotbeknownoraccountablebythemodellerorthemodel

11

5.2)InputUncertainty
Inadditiontomodeluncertainty,thereareuncertaintiesduetoerrorsininputvariablessuchasrainfall
andtemperature,aspointmeasurementsareusedindistributedmodels.Itisquitedifficulttoaccount
forinputuncertainty.Someresearchersproposetreatinginputsasrandomvariable,whichallowsfitting
them to get better simulations. As model outputs are very sensitive to input data, especially rainfall,
caremustbetakeninsuchapproaches.Inmountainousregions,inputuncertaintycouldbeverylarge.

5.3)Parameternonuniqueness
Asinglevaluedparameterresultsinasinglemodelsignalindirectmodeling.Inaninverseapplication,
anobservedsignal,however,couldbemorelessreproducedwiththousandsofdifferentparametersets.
Thisnonuniquenessisaninherentpropertyofinversemodeling(IM).IM,hasinrecentyearsbecomea
verypopularmethodforcalibration(e.g.,BevenandBinley,1992,2001;Abbaspouretal.,1997,2007;
Duan et al., 2003; Gupta et al., 1998). IM is concerned with the problem of making inferences about
physical systems from measured output variables of the model (e.g., river discharge, sediment
concentration). This is attractive because direct measurement of parameters describing the physical
system is time consuming, costly, tedious, and often has limited applicability. Because nearly all
measurementsaresubjecttosomeuncertainty,theinferencesareusuallystatisticalinnature.

GW_DELAY
3.46
0.34

CH_N2
0.0098
0.131

CN2
50
20

REVAPMN
0.8
2.4

Sol_AWC
0.11
0.2 3

g
0.010
0.011

Figure9.Exampleofparameternonuniquenessshowingtwosimilardischargesignalsbasedonquite
differentparametervalues
Furthermore, because one can only measure a limited number of (noisy) data and because physical
systems are usually modelled by continuum equations, no hydrological inverse problem is really
uniquely solvable. In other words, if there is a single model that fits the measurements there will be

12

manyofthem.AnexampleisshowninFigure9wheretwoverydifferentparametersetsproducesignals
similartotheobserveddischarge.Ourgoalininversemodellingisthentocharacterizethesetofmodels,
mainlythroughassigningdistributions(uncertainties)totheparameters,whichfitthedataandsatisfy
ourpresumptionsaswellasotherpriorinformation.

TheSwisscheeseeffect
Thenonuniquenessproblemcanalsobelookedatfromthepointofviewofobjectivefunction.Plotting
the objectivefunction response surface for two by two combinations of parameters could be quite
revealing.Asanexample,seeFigure10wheretheinverseofanobjectivefunctionisplottedagainsttwo
parameters,hence,localminimaareshownaspeaks.Sizeanddistributionofthesepeaksresemblesthe
mysteriousholesinablockofSwissEmmentalercheesewherethesizeofeachholerepresentsthelocal
uncertainty. Ourexperienceshowsthateach calibrationmethodconverges toonesuch peak(see the
papers by Yang et al., 2008, Schuol et al., 2008a, and Faramarzi et al., 2008). Yang et al., (2008)
compared Generalized Likelihood Uncertainty Estimation (GLUE) (Beven and Binley, 1992), Parameter
Solution (ParaSol) (Van Griensven and Meixner, 2003a), Sequential Uncertainty Fitting (SUFI2)
(Abbaspouretal.,2004;2007),andMarkovchainMonteCarlo(MCMC)(e.g.,KuczeraandParent,1998;
Marshalletal.,2004;Vrugtetal.,2003;Yangetal.,2007)methodsinanapplicationtoawatershedin
China. They found that these different optimization programs each found a different solution at
different locations in the parameter spaces with more less the same discharge results. Table 1 has a
summaryofthecomparison.
To limit the nonuniqueness, the objective function should be made as comprehensive as possible by
including different fluxes and loads (see Abbaspour et al., 2007). The downside of this is that a lot of
data should be measured for calibration. The use of remote sensing data, when it becomes available,
couldbeextremelyuseful.Infactwebelievethatthenextbigjumpinwatershedmodelingwillbemade
asaresultofadvancesinremotesensingdataavailability.
Further errors could also exist in the very measurements we use to calibrate the model. These errors
could be very large, for example, in sediment data and grab samples if used for calibration. Another
uncertainty worth mentioning is that of modeler uncertainty! It has been shown before that the
experience of modelers could make a big difference in model calibration. We hope that packages like
SWATCUPcanhelpdecreasemodeleruncertaintybyremovingsomeprobablesourcesofmodelingand
calibrationerrors.
Onafinalnote,itishighlydesirabletoseparatequantitativelytheeffectofdifferentuncertaintieson
model outputs, but this is very difficult to do. The combined effect, however, should always be
quantifiedonmodeloutputs.

13

Figure10.Amultidimensionalobjectivefunctionismultimodalmeaningthattherearemanyareasof
goodsolutionswithdifferentuncertaintiesmuchlikethemysteriousholesinasliceofSwisscheese.

14

Table1.Summarystatisticscomparingdifferentcalibrationuncertaintyprocedures.
Criterion

GLUE

ParaSol

SUFI2

NashSutcliffe

NashSutcliffe

Goalfunction
a__CN2.mgt
v__ESCO.hru
v__EPCO.hru
r__SOL_K.sol
a__SOL_AWC.sol
v__ALPHA_BF.gw
v__GW_DELAY.gw
r__SLSUBBSN.hru
a__CH_K2.rte
a__OV_N.hru
2
dry
2
wet
2
dry
2
wet

NSforcal(val)
R2forcal(val)
LogPDFforcal(val)
3
pfactorforcal
(val)
4
dfactorforcal
(val)
Uncertainty
describedby
parameter
uncertainty
Difficultyof
implement.
Numberofruns

NashSutcliffe

16.8(29.6,
21.0 (21.9,
9.8)1
20.1)
0.76(0.02,0.97)
0.67(0.65,0.69)
0.22(0.04,0.90)
0.16(0.13,0.20)
0.16(0.36,
0.37(0.41,
0.78)
0.34)
0.11(0.01,0.15) 0.07(0.08,0.08)
0.12(0.06,0.97) 0.12(0.08,0.13)
107.7(91.2,115.2)
159.58(9.7,
0.59(0.60,
289.3)
0.58)
0.45(0.56,
35.70
0.46)
(27.72,37.67)
78.19(6.0,144.8)
0.11(0.07,0.10)
0.05(0.00,0.20)

0.80(0.78)
0.82(0.81)
0.80(0.84)
0.82(0.85)
1989(926)
2049(1043)
79%(69%)
18% (20%)

Bayesianinferencewithcont.
autoregr.errormodel
MCMC
IS

26.9(30.0,7.2)
0.82(0.43,1.0)
1(0.34,1.0)
0.1(0.58,0.34)
0.07(0.05,0.15)
0.51(0.23,0.74)
190.07(100.2,300)
0.52(0.60,0.03)
83.95(69.4,150.0)
0.06(0.00,0.11)

post.prob.
density
14.2(16.8,
11.6)
0.74(0.63,0.75)
0.94(0.39,0.98)
0.29(0.31,0.78)
0.12(0.1,0.13)
0.14(0.11,0.15)
25.5(17.8,33.3)
0.55(0.56,
0.15)
78.3(68.0,86.2)
0.12(0.00,0.19)
0.93(0.81,1.10)
2.81(2.4,3.9)
38.13(29.5,53.8)
3.42(2.4,8.0)

post.prob.
density
19.60
0.62
0.27
0.01
0.05
0.91
33.15
0.58
147.23
0.08
0.87
2.30
28.47
0.92

0.80(0.75)
0.81(0.81)
2426 (1095)
84% (82%)

0.77(0.77)
0.78(0.81)
1521(866)
85%(84%)

0.64 (0.71)
0.70(0.72)
1650(801)

0.65(0.51)

0.08 (0.07)

1.03 (0.82)

1.47(1.19)

Allsourcesof
uncertainty

Parameter
uncertaintyonly

Allsourcesof
uncertainty

Parameter
uncertaintyonly

Parameter
uncertainty
only

veryeasy

easy

easy

morecomplicated

10000

7500

1500+1500

5000+20000+
20000

more
complicated
100000

c(a,b)foreachparametermeans:cisthebestparameterestimate,(a,b)isthe95%parameter
uncertaintyrangeexceptSUFI2(inSUFI2,thisintervaldenotesthefinalparameterdistribution).
2
thedry,wet,dry,andwetusedtocalculatetheCalculatethelogarithmoftheposteriorprobability
densityfunction(PDF)arefromthebestofMCMC.
3
pfactormeansthepercentageofobservationscoveredbythe95PPU
4
dfactormeansrelativewidthof95%probabilityband(AfterYangetal.,2008)

15

SUFI2
SequentialUncertaintyFitting
version2

Discharge Calibration
700

measured data bracketed by the 95PPU = 91%


600

d-factor = 1.0

-1

Daily discharge (m s )

500

400

300

200

100

0
01.01.91

01.07.91

01.01.92

01.07.92

01.01.93

01.07.93

01.01.94

01.07.94

01.01.95

01.07.95

Date

01.01.96

16

ConceptualbasisoftheSUFI2uncertaintyanalysisroutine
The deterministic approach to calibration is now outdated and unacceptable. Example of a
deterministic optimization is trial and error. Meaning you keep adjusting parameters until you get
some kind of a reasonable match between simulation and observation. Reporting this as a calibrated
model,inmyopinioniswrong,andwillnotstandinanycourtoflaw,ifitcomestothat.Here,wewill
not further discuss the deterministic approaches that result in a single set of parameters claiming to
representthebestsimulation.
In stochastic calibration, we recognize the errors and uncertainties in our modeling work and try to
capture,tosomedegree,ourignoranceandlackofunderstandingoftheprocessesinnaturalsystems.
There is an intimate relationship between calibration and uncertainty (Abbaspour, et al., 2015).
Reporting the uncertainty is not a luxury in modeling, it is a necessity. Without the uncertainty,
calibration is meaningless and misleading. Furthermore, any analysis with the calibrated model must
includetheuncertaintyintheresultbypropagatingtheparameteruncertainties.
In SUFI2, uncertainty in parameters, expressed as ranges (uniform distributions), accounts for all
sources of uncertainties such as uncertainty in driving variables (e.g., rainfall), conceptual model,
parameters, and measured data. Propagation of the uncertainties in the parameters leads to
uncertainties in the model output variables, which are expressed as the 95% probability distributions.
Thesearecalculatedatthe2.5%and97.5%levelsofthecumulativedistributionofanoutputvariable
generated by the propagation of the parameter uncertainties using Latin hypercube sampling. This is
referred to as the 95% prediction uncertainty, or 95PPU. These 95PPUs are the model outputs in a
stochastic calibration approach. It is important to realize that we do not have a single signal
representing model output, but rather an envelope of good solutions expressed by the 95PPU,
generatedbycertainparameterranges.
In SUFI2, we want that our model result (95PPU) envelops most of the observations. Observation, is
whatwehavemeasuredinthenaturalsystem.Observationisimportantbecauseitistheculminationof
alltheprocessestakingplaceintheregionofstudy.Theargument,howevernave,isthatifwecapture
the observation correctly with our model, then we are somehow capturing correctly all the processes
leadingtothatobservation.Theproblem,ofcourse,isthatoftenacombinationofwrongprocessesin
ourmodelmayalsoproducegoodsimulationresults.Forthisreason,themorevariables(representing
different processes) we include in the objective function, the more likely we are to avoid the wrong
processes.
Toquantifythefitbetweensimulationresult,expressedas95PPU,andobservationexpressedasasingle
signal (with some error associated with it) we came up with two statistics: Pfactor and Rfactor (see
Abbaspour et al., 2004, 2007 references provided in the reference list of SWATCUP). Pfactor is the
percentageofobserveddataenvelopedbyourmodelingresult,the95PPU.Rfactoristhethicknessof
the95PPUenvelop.InSUFI2,wetrytogetreasonablevaluesofthesetwofactors.Whilewewouldlike
tocapturemostofourobservationsinthe95PPUenvelop,wewouldatthesametimeliketohavea
smallenvelop.Nohardnumbersexistforwhatthesetwofactorsshouldbe,similartothefactthatno
hardnumbersexistforR2orNS.Thelargertheyare,thebettertheyare.ForPfactor,wesuggesteda
valueof>70%fordischarge,whilehavingRfactorofaround1.Forsediment,asmallerPfactoranda
largerRfactorcouldbeacceptable.
SUFI2 operates by performing several iterations, usually at most <5. In each iteration, the parameter
rangesgetsmaller zoomingonaregionoftheparameterspace,which producedbetterresultsinthe

17

previousiteration.Naturally,asparameterrangesgetsmaller,the95PPUenvelopgetssmaller,leading
tosmallerPfactorandsmallerRfactor.Aseachiterationzoomsintoabetterregionoftheparameter
space,obtainedbythepreviousiteration,itisgoingtofindabetterbestsolution.So,ifyouhaveNSas
yourobjectivefunction,thenyouwillgetabetterNSinsubsequentiterations,butthePfactorandR
factor will decrease because of narrower parameter ranges. But the idea is not to find that so called
bestsimulation.Because,1)therearealwaysbettersimulations,and2)thedifferencebetweenthe
best simulation and the next best simulation and the next next best simulation is usually
statisticallyinsignificant(e.g.,NS=0.83vsNS=0.81areprobablynotsignificantlydifferent),meaningthat
theycouldbothbeidentifiedasthebestsimulations.Butwhilethedifferencesareinsignificantinterms
oftheobjectivefunctionvalue,theyareverysignificantintermsofparametersvalues.Therefore,the
nextbestsolutioncannotbeignored.
TheconceptbehindtheuncertaintyanalysisoftheSUFI2algorithmisdepictedgraphicallyintheFigure
below.ThisFigureillustratesthatasingleparametervalue(shownbyapoint)leadstoasinglemodel
response (Fig. a), while propagation of the uncertainty in a parameter (shown by a line) leads to the
95PPU illustrated by the shaded region in Figure b. As parameter uncertainty increases, the output
uncertainty also increases (not necessarily linearly) (Fig. c). Hence, SUFI2 starts by assuming a large
parameteruncertainty (withina physicallymeaningfulrange),sothatthe measureddatainitiallyfalls
within the 95PPU, then decreases this uncertainty in steps while monitoring the Pfactor and the R
factor. In each step, previous parameter ranges are updated by calculating the sensitivity matrix
(equivalenttoJacobian),andequivalentofaHessianmatrix,followedbythecalculationofcovariance
matrix, 95% confidence intervals of the parameters, and correlation matrix. Parameters are then
updated in such a way that the new ranges are always smaller than the previous ranges, and are
centeredaroundthebestsimulation(formoredetailseeAbbaspouretal.,2004,2007).

A conceptual illustration of the relationship between parameter uncertainty and prediction


uncertainty
The goodness of fit and the degree to which the calibrated model accounts for the uncertainties are
assessedbytheabovetwomeasures.Theoretically,thevalueforPfactorrangesbetween0and100%,
whilethatofRfactorrangesbetween0andinfinity.APfactorof1andRfactorofzeroisasimulation
thatexactlycorrespondstomeasureddata.Thedegreetowhichweareawayfromthesenumberscan
beusedtojudgethestrengthofourcalibration.A

18

largerPfactorcanbeachievedattheexpenseofalargerRfactor.
Hence,oftenabalancemustbereachedbetweenthetwo.WhenacceptablevaluesofRfactorandP
factor are reached, then the parameter uncertainties are the desired parameter ranges. Further
goodness of fit can be quantified by the R2 and/or NashSutcliff (NS) coefficient between the
observations and the final best simulation. It should be noted that we do not seek the best
simulationasinsuchastochasticprocedurethebestsolutionisactuallythefinalparameterranges.
Ifinitiallywesetparameterrangesequaltothemaximumphysicallymeaningfulrangesandstillcannot
finda95PPUthatbracketsanyormostofthedata,forexample,ifthesituationinFiguredoccurs,then
theproblemisnotoneofparametercalibrationandtheconceptualmodelmustbereexamined.

SUFI2asanoptimizationalgorithm
ForadescriptionofSUFI2seeAbbaspouretal.,(2004,2007).ReferencesareprovidedintheReference
directoryofSWATCUP.
ForacalibrationprotocolseeAbbaspouretal.,(2015).
http://www.sciencedirect.com/science/article/pii/S0022169415001985

19

SWATCUP
Automatedmodelcalibrationrequiresthattheuncertainmodelparametersaresystematicallychanged,
the model is run, and the required outputs (corresponding to measured data) are extracted from the
modeloutputfiles.Themainfunctionofaninterfaceistoprovidealinkbetweentheinput/outputofa
calibrationprogramandthemodel.Thesimplestwayofhandlingthefileexchangeisthroughtextfile
formats.
SWATCUP is an interface that was developed for SWAT. Using this generic interface, any
calibration/uncertaintyorsensitivityprogramcaneasilybelinkedtoSWAT.Aschematicofthelinkage
betweenSWATandfiveoptimizationprogramsisillustratedintheFigurebelow.

20

StepbystepCreatingofSWATSUFI2InputFiles

par_inf.txt

SUFI2_LH_sample.exe

par_val.txt

SUFI2_new_pars.exe

BACKUP

SUFI2_swEdit.def

SWAT_Edit.exe

Modified
SWAT inputs

SUFI2_extract_rch.def

swat.exe

SWAT
outputs
observed.txt

SUFI2_extract_rch.exe

*.out

SUFI2_goal_fn.exe

SUFI2_95ppu.exe

goal.txt
Is
calibration
criteria
satisfied?

no

yes

stop

21

1.BeforeSWATCUP
BecomefamiliarwithSWATparameters.TheyareallexplainedintheSWATI/Omanual.Also,readthe
theoryandapplicationofSWATSUFI2atthebeginningofthismanualandinthefollowingpapers:
Thurwatershedpaper(Abbaspouretal.,2007)
LandfillapplicationinSwitzerland(Abbaspouretal.,2004)
ThecontinentalapplicationinAfrica(Schuoletal,2008a,b)andEurope(Abbaspouretal,2014)
ThecountrybasedapplicationinIran(Faramarzietal.,2008)
Thecomparisonofdifferentoptimizationprograms(Yangetal.,2008)
Theparallelprocessingpaper(Rouholahnejadetal.,2013)
TheBlackSeaapplicationpaper(Rouholahnejadetal.,2014)
TheapplicationtoentireEurope(Abbaspouretal.,2015)
(http://www.sciencedirect.com/science/article/pii/S0022169415001985)
AndothersprovidedintheC:\SWAT\SWATCUP\ExternalData\References

2.StartSWATCUP
InstalltheSWATCUPinC:\SWAT\SWATCUP,thesamedirectoryastheSWATandstarttheprogramby
pressingtheSWATCUPicononthedesktop:

3.OpenaProject
Toopenaneworoldproject:Pressthe

symbolatthetopleftcorner

andchooseaNeworOpenanoldproject

22

For a new project locate a SWAT TxtInOut directory. Any file with TxtInOut in the name string
wouldbeacceptable

ChooseSWATandprocessorversions

Selectaprogramfromthelistprovided(SUFI2,GLUE,ParaSol,MCMC,PSO).Adetailedexplanationof
theSUFI2procedureisofferedhere,butallprogramsfollowthesameformat.

GiveanametotheprojectandalocationwhereSWATCUPprojectcanbesaved.

23

NotethedefaultadditiontothenameprovidedinthewindowtotherightofProjectNamewindow.
For a SUFI2 project, the full SWATCUP directory name in the example below would be
test_1.Sufi2.SwatCup,whichwillresideinc:\ArcSWATprojects\Black_Seadirectory.

AtthispointTheprogramcreatesthedesiredprojectdirectoryandcopiesthereallTxtInOutfilesfrom
theindicatedlocationintotheSWATCUPprojectdirectory.ItalsocreatesadirectorycalledBackupin
thesameSWATCUPprojectdirectoryandcopiesallSWATTxtInOutfilethere.Theparametersinthe
filesintheBackupdirectoryserveasthedefaultparametersanddonotchangedduringthecalibration
process.TheBackupdirectoryisalwaysneededasitsoriginalformbecause,relativechangesthat
havebeenmadetotheparametersduringcalibration,weremaderelativetotheparametervaluesin
theBackupdirectory.Therefore,itisimportantthattheBackupdirectoryisneverchanged.

4.SWATOutputFiles
Youcancalibratethemodelbasedonthevariablesfromoutput.rch,output.hru,output.sub,output.res,
output.mgt,andnowalsohourlygeneratedfiles.However,theinterfaceonlyshows.rch,.hru,and.sub
files.Asmostoftenwehaveeitherdischarge,nutrientsdata,orsedimentdata,onlytheseareshownin
theinterface.Justclickandactivatewhichfileyouwanttouse(i.e.,yourobservedvariablesresidein
whichSWATfile(s)).

24

5.CalibrationInputs
UndertheCalibrationInputseditthefollowingfiles:

Par_inf.txt
This file resides in the project directory in SUFI2.IN directory. It contains input parameters to be
optimized. An example is provided, which needs to be edited by the user. The examples shows the
formatofthefile.Editthistoyourneeds.Atextviewandaformviewisprovided.Theformviewhelps
with finding the correct parameter syntax or expression. All SWAT parameters (up to the time of
compilationofthelastswatcupversion)canbefoundhere.TheformviewfollowsstandardWindows
protocol and the users are advised to familiarize themselves with this module by testing different
features of it. What you do in the form view, appears in the text view and vice versa. Users are also
encouraged to try different things in the form view and look at the them in the text view to become
familiarwiththisimportantanduniquefeatureofSWATCUP.
Thisfilecontainsthenumberofparameterstobeoptimizedandthenumberofsimulationstomakein
the current iteration. SUFI2 is iterative, each iteration contains a number of simulations. Around 500
simulations are recommended in each iteration. But if a swat project takes too long to run, fewer
numberofsimulations(200300)ineachiterationcouldbeacceptable.Parametersaresampledusing
Latinhypercubeschemeexplainedlaterinthemanual.Usually,notmorethan4iterationsaresufficient
to reach an acceptable solution. A parallel processing module is also available to speed up the
calibrationprocess.
To learn more about parameterization and parameter qualifiers r__, v__, and a__ please see the
sectiononparameterizationbelow.

25

What parameters to use depend on the objective function. Initially, in every case, flow should be
calibrated and then water quality variables added one at time (see Abbaspour et al., 2007, 2015 for
parameterchoicesandcalibrationprotocol).

SUFI2_swEdit.def
This file contains the beginning and the ending simulation years. Please note that the beginning
simulation does not include the warm up period. SWAT simulates the warm up period but does not
printanyresults,therefore,theseyearsarenotconsideredinSWATCUP.Youcancheckoutput.rchfile
ofSWATtoseewhenthebeginningandtheendingsimulationtimesis.

26

File.cio
ThisisaSWATfile.Itisputhereforconvenience.Whatyouneedfromthisfilearethesimulationyears
andthenumberofwarmupyears(NYSKIP)tocorrectlyprovideSWATCUPwithbeginningandendyear
ofsimulation.Itisrecommendedthatyouhave23yearsofwarmupperiod.

.
.

Missspecifyingthecorrectdatesisthecauseofbiggestusererror!Pleasenotethefollowing:
-

Intheaboveexample,beginningyearofSWATsimulationis1987,endyearis2001
There are 3 years of warm up period as indicated by NYSKIP. Therefore, SWAT output files
contain data from 1990 to 2001. These dates are of interest to SWATCUP. So, in SWATCUP
beginningyearis1990andendyearis2001.
AlsonotethatSWATCUPrequirestheIDAF tobeatthe beginningof theyear(always1)and
IDALtogototheendoftheyear(365or366forleapyears).ThereforeSWATsimulationshould
always be from the beginning to the end of the year. So your climate data must be from the
beginningtotheendoftheyear.

Absolute_SWAT_Values.txt
Allparameterstobefittedshouldbeinthisfileplustheirabsoluteminandmaxranges.Currentlymost,
butperhapsnotallparametersareincludedinthisfile.Simplyaddtoittheparametersthatdontexist.
The SWAT_Edit.exe program, that replaces parameters in the SWAT files, does not allow parameters
beyondthisrangeintoSWATfiles.

etc.

27

6.Observation
Under Observationarethreefilesthatcontaintheobservedvariables.Observedvariablescorrespond
to the variables in output.rch, output.hru, and output.sub, output.res, and output.mgt files, although
thelattertwodonotappearinSWATCUP.

Initially, all options are deactivated. To activate you need to choose which SWAT file contains the
simulateddata(step4above).Variablesfromdifferentfilescanbeincludedtoformamulticomponent
objectivefunction.Simplyonlyeditthefile(s)thatappliestoyourprojectanddonotworryaboutthe
onesthatdont.Theformatshouldbeexactlyasshownintheexamplesprovidedintheprogram.The
three files Observed_rch.txt, Observed_hru.txt, and Observed_bsn.txt can be edited here, but
observed_res.txtforreservoirdataandobserved_mgt.txtforcropyieldarealsoavailablethatcouldbe
editeddirectlyinthe.\SUFI2.INdirectoryintheSWATCUPprojectdirectory.

Missingvalues
Theformatoftheobservationfilesareasshownintheexamplesprovided.Thesefilescouldeasilybe
madeinExcelandpastedhere.IntheobservedfilesYoumayhavemissingdatathatcanbeaccounted
forasshownintheexamplefilesandexplainedbelow.
Thefirstcolumnhassequentialnumbersfromthebeginningofsimulationtimeperiod.Intheexample
below,thefirst10monthsaremissingsothefirstcolumnbeginsfrom11.Also,months18,19,and20
aremissing.

28

Thesecondcolumnhasanarbitraryformatbutitshouldbeoneconnectedstring.Here,itisshowing
thevariablename,month,andyear.Thirdcolumnisthevariablevalue.
Ifbaseflowisseparated,anddynamicbaseflowisused,thenaforthcolumnindicatingthebaseflow
should also be added. The example of an observation file with base flow is given in observed+.txt
in.\SUFI2.INdirectory.
Allotherobservation_*.txtfileshavethesameformat.ThisfiletellstheextractprogramsofSWATCUP
whattoextractfromtheSWAToutputfiles.
Theobserved_rch.txtfilescancontainmanyvariablessuchas discharge,sediment,nitrate,etc.which
appearintheSWAToutputfileoutput.hru.Simplyusethesameformatforallvariablesasshowninthe
examples.Also,forthevariablesname,beconsistentinallSWATCUPfiles.

7.Extraction
UnderExtractionyouwillfindtwotypesoffiles.txtand.defcorrespondingagaintoSWAToutputfiles
output.rch, output.hru, and output.sub. If you have observations corresponding to variables in these
files,thenyouneedtoextractthecorrespondingsimulatedvaluesfromthesefilesonly.

29

.txtfilessimplycontainthenamesofthefilesthatextractedvaluesshouldbewrittento,and.deffiles
define which variables need to be extracted from which subbasins. These files are relatively self
explanatory.Hereagainonlyedittheneededfiles.

Intheexampleprovided,wehave4measuredvariables,3dischargesfromsubbasins1,3,7,and1nitrate
from subbasin 7. The extract files of SWATCUP extract the corresponding simulated data from
output.rchfileandwritethemtothefilesindicatedhereforeverysimulation.
BelowisanexampleofSUFI2_extrcat_rch.def

30

Thefileisselfexplanatory.Weareextracting2variables:dischargeandnitrate.Theyareincolumns7
and 18 in the output.rch file. There are a total of 20 subbasins in the project. For discharge, we have
flow measurements from subbasins 1, 3, and 7. For nitrate we have measurement from subbasin
number7only.Thebeginningdatedoesnotincludewarmupperiod.

8.Objectivefunction
Next,ObjectiveFunctionisdefined.InthissteptwofilesObserved.txtandVar_file_name.txtshouldbe
edited. The Observed.txt file contains all the information in observed_rch.txt, observed_hru.txt,
observed_sub.txtfiles,plussomeextrainformationforthecalculationoftheobjectivefunction.

Var_file_name.txt contains the names of all the variables that should be included in the in the
objectivefunction.Thesenamesaresimilartothenamesinthevar_file_*.txtintheExtractionsection.

Observed.txtfilealsoisquiteselfexplanatory.

31

Inthisexamplewehave4variables.Wehaveanoptiontochoosefrom10differentobjectivefunctions.
ReadthesectiononObjectiveFunctionbelowformoreexplanationofthefunctions.
Thethirdlineisoptional torun,butthereshould beanumberhere. Ifyou expressathresholdvalue
here,thenallsimulationswithobjectivefunctionvaluebetterthanthethresholdarecollectedandthe
95PPU calculated based on those simulations. Here, the SUFI2 becomes similar to GLUE. The pfactor
and the rfactor for a given threshold may be different from the solution where threshold is not
considered. Please note that the threshold value must correspond to the type of objective function
beingused.

Baseflowseparation
Two options are provided to consider baseflow separation: static and dynamic. In the static case, a
constant thresholdvalueforbaseflowisused.This values,dividesthedischargesignalintotwoparts.
Valuessmallerthanthethresholdandvalueslargerthanthethresholdaretreatedastwovariablesand
carrytwodifferentweights.Thisisto ensurethat, forexample, baseflowhasthesamevaluesasthe
peakflows.Withoutthisdivision,ifyouchooseoption2forobjectivefunction,i.e.,meansquareerror
(see objective function section below), then the small flows will not have much effect on the
optimization. Hence, peak flow will dominate the processes. With the static threshold option, small
flows can be given a larger weight in the objective function so that they have almost the same
contribution to the objective function as the peak flows. The base flow separation is most effective
whenoption2ischosenforobjectivefunction.Separatingthebaseflowdoesnotbecomeverycriticalif
R2orbR2isusedforobjectivefunction.

Threshold=35

Tonotusethisoption,simplyset constantflowseparationthresholdtoanegativevalue (say1fora


variablethatisalwayspositive)andtheweightsforsmallerandlargerflowsto1.

32

In the dynamic case, a flow separation program should be used to calculate the base flow. Both
observedflowandbaseflowmustthenappearintheobserved.txtfileastwoseparatecolumns,column
3andcolumn4,respectively,asshownintheobserved+.txtexamplefilein.\SUFI2.INdirectory.

Percentageofmeasurederror
Thisvaluereferstothemeasurementerror.Adefaultvalueof10%isspecified,buttheuserscanchange
thisbasedontheirknowledge.Thisvalueisreasonableforflow,butshouldbehigherforothervariables
suchassedimentandnitrate,etc.

9.No_Observations
The No_Observation section is designed for the extraction and visualization of uncertainties for the
variables for which we have no observation, but would like to see how they are simulated such as
variousnutrientloads,orsoilmoisture,ET,etc.The.txtfilesareinactive.

The.deffileshavemoreorlessthesameformatastheExtractionsection.
Extract_rch_No_Obs.def

Extract_hru_No_Obs.def

Extract_sub_No_Obs.def

This files is also selfexplanatory. The number of variables to get, column numbers (sequential), and
representativevariablenamesarespecified(Risusedheretoindicatethesearefromoutput.rchSWAT

33

file) in rows 35. These names are used to build files where simulated values are collected for all
simulations.Thentotalnumberofsubbasinsintheprojectisspecified.
Foreachvariable,weidentifythenumberofsubbasinstoget,andthesubbasinnumber(s).Ifwewant
to get all subbasin values, for example for plotting maps, then simply indicate ALL. This followed by
beginningandendyearofsimulation.Again,beginningyearofsimulationshouldnotincludewarmup
period.

95ppu_No_Obs.def
Finally,forNO_Observationoptionweneedtoeditthe95ppu_No_Obs.deffile.Thisisafileusedforthe
calculationofthe95ppufortheextractedvariableswithnoobservation.
95ppu_No_Obs.def

Thisfileagainisquiteselfexplanatory.Thenumberofvariablesforwhich95PPUistobecalculatedis
giveninthesecondrow.Variablesnamesarethenprovided.Thesenamesshouldbeexactlythesame
astheonesgiveninthe.deffile(s).Finally,thenumberofsimulationtimestepsaregiven.For12years
ofmonthlysimulationthiswouldbe144.

34

10.Executables
ThesectiononExecutableFilesplaystheroleofengineinSWATCUP.Thefourbatchfilesindicatewhat
shouldorshouldnotberun.

SUFI2_pre.bat
This batch file runs the preprocessing procedures. It include running the Latin hypercube sampling
program.Thisbatchfileusuallydoesnotneedtobeedited.

NotethatmanyfilesattheendhaveFormViewandTextView.IntheTextViewyouhavethetextfile,
whichappearsinyouSWAZCUPprojectdirectory.Youcaneasilyeditthistextfileasneededwiththe
sameformatasshown.

35

SUFI2_run.bat
This program executes SUFI2_execute.exe program, which runs the SWAT_Edit.exe, extraction batch
files,aswellasSWAT.exe.

SUFI2_post.bat
runs the postprocessing batch file, which runs the programs for objective function calculation, new
parametercalculation,95ppucalculation,95ppuforbehavioralsimulations,and95ppuforthevariables
withnoobservations(optional).IntheTextFormonecanuncheckaprogramifitisnotneededtorun.

36

SUFI2_Extract.bat
Thisbatchfilecontainsthenamesofalltheextractprogramswithorwithoutobservations.Currently8
programsaresupported.Thisfilemustbeeditedandtheprogramsthatarenotdesiredtorunshouldbe
remarkedoruncheckedasshownbelow:

11.BeforeCalibration
Atthispointtheinputfilesarecompleteandtheprojectisreadytobecalibrated.Butbeforestartingan
iteration,youneedtomakesurethatthemodelyouhavebuiltinfeasibleinitially.So,youshouldmake
afirstrunwiththeinitialmodelstructureandinitialmodelparameters.
TochecktheinitialmodelwithSWATCUPdothefollowing:
1InPar_inf,putthenumberofsimulationsandthenumberofparametersto1
2InSUFI2_swEditputthebeginningandtheendingsimulationalsoto1
3Setupadummyparametersuchas
r__SFTMP.bsn

(thisdoesnotchangeanything)

4Thenexecuteinorder:Pre,Run,andPostprocessing.
Nowlookatthe95PPUresultofyourdefaultorinitialmodelrun.Ifsimulationsandobservationsaretoo
different,thenyouneedtotakeacloserlookatyourswatmodel,includingrainfall,etc.Else,lookatthe
calibrationprotocolin(http://www.sciencedirect.com/science/article/pii/S0022169415001985)to
adjusttheparameterinawayastoachievethebestsimulationresultateachobservedoutlet.
Forthisinitialsimulation,youshouldalsolookattheoutput.stdfiletomakesuretheoverallwatershed
flowcomponentsarecorrectornot.

37

12.Calibration
Next,aftereditingalltheinputfiles,performSaveAllandCloseAlltasks.Theruntheprogramsin
theCalibrationwindowintheorderthattheyappear.Inthissectionthreestepsareperformed:

i)
Sufi2_pre.batThiscommandrunstheSufi2_pre.batfile.Thisfilemustberunbeforethestart
ofeverynewiteration.
ii)
SUFI2_run.batThiscommandexecutestherunbatchfile.
iii)
SUFI2_post.batAfterallsimulationsarefinished,thiscommandexecutesthepostprocessing
batchfiledescribedabove.

38

13.CalibrationOutputs

95ppuplot
Thiscommandshowsthe95ppuofallvariables.Alsoshownareobservationsandbestsimulationofthe
currentiteration.PleaseNotethatthebestsimulationisonlyshownforhistoricreason.Thesolutionto
thecalibrationatthisstageisthe95PPUgraphandtheparameterrangesthatwereusedtogenerateit.
Notethefeatureswitharrowwhereyoucanchangethevariablesaswellaszoomingthehydrograph.

39

Also,pleasenotetheoptionsgivenbyChartLayoutandPrintPreview

95ppuNo_Observedplot
Thiscommandshowsthe95ppuofallvariableswithnoobservations.Hereyouonlyseetheuncertainty
insimulationofSoilMoisture,avariableforwhichwehavenoobservation.

DottyPlots
Thiscommandshowsthedottyplotsofallparameters.Theseareplotsofparametervaluesorrelative
changesversusobjectivefunction.Themainpurposeofthesegraphsaretoshowthedistributionofthe
samplingpointsaswellastogiveanideaofparametersensitivity.Inthefollowingfigureyouseeanice
trend for CN2 as it increases. Objective function is NashSutcliffe (NS). Clearly CN2 is a sensitive
parameteranditsbestfittingvaluesarelessthan0.1inrelativechange(r__).ButALPHA_BFdoesnot
appeartobesensitiveasthevalueofobjectivefunctiondoesntreallychange.GW_DELAYalsoisnot
verysensitive,butitsvalueshouldprobablynotbeabove300,GWQMNalsonotverysensitive,butit
shouldprobablybesomewhereabove0.6.Moreaboutsensitivitylater.

40

Best_Par.txt
This file shows the best parameter values as well as their ranges. These are the parameters, which
gavethebestobjectivefunctionvalueinthecurrentiteration.Again,Iliketoemphasizethatthebest
parameterreallydoesnotmeanverymuchasthenextobjectivefunctionvaluemaynotbestatistically
nottoodifferentfromthebestone.Theparameterrangesarethesolutionforthisiteration.

41

Best_Sim.txt
This file shows the best simulated values for all the variables used in the objective function. Both
observedandsimulatedvaluesaregivensothattheycouldeasilybeplottedwithothersoftwaresas
desired.

Goal.txt
Thisfileshowsthevalueofallparametersetsforthesimulationsperformedaswellasthevalueofthe
goalfunctioninthelastcolumn.Thisfileisusedlatetocalculatethesocalledglobalsensitivity.

New_Pars.txt
This file shows the suggested values of the new parameters to be used in the next iteration. These
values can be copied and pasted in the Par_inf.txt file for the next iteration, or alternatively, the
Import New Parameters could be used to copy new parameters into par_inf.txt file. The new
parametersshouldbecheckedforpossibleunreasonablevalues(e.g.,negativehydraulicconductivity,

42

etc.). These suggested parameter ranges should be manually corrected and if desired directed to a
certainrangebytheuserincaseofavailableinformationorknowledgeofthesystem.

Summary_Stat
Thisfilehasthestatisticsofcomparingobserveddatawiththesimulationbandthroughpfactorandr
factorandthebestsimulationofthecurrentiterationbyusingR2,NS,bR2,MSE,SSQR,PBIAS,KGE,RSR,
andVOL_FR.Themeanandstandarddeviationoftheobservedandsimulatedvariablesarealsogiven
attheend.Fordefinitionofthesefunctionsseethesectiononobjectivefunctions.Alsoshownisthe
goalfunctiontype,bestsimulationnumberofthecurrentiteration,andthebestvalueoftheobjective
functionforthecurrentrunonthetop.
If behavioral solutions exist, then the pfactor and rfactor for these solutions are also calculated. As
showninthefollowingTabletheeffectofusingbehavioralsolutionsistoobtainsmallerpfactorandr
factor,orasmallerpredictionuncertainty.

43

14.Sensitivityanalysis
Thismoduleoftheprogramperformssensitivityanalysis.Twotypesofsensitivityanalysisareallowed.
GlobalSensitivityandOneatatimesensitivityanalysis.

Globalsensitivityanalysiscanbeperformedafteraniteration.Oneatatimesensitivityisperformedfor
oneparameteratatimeonly.Theprocedureisexplainedinthenextsection.

15.Maps
TheMapsmoduleenablesvisualizationoftheoutlets.TheBingmapisusedtoprojectthelocationof
outlets,rivers,climatestations,andsubbasinsontheactualmapoftheworld.

44

When you invoke the Outlet Map, the Bing map is activated and the program asks for the ArcSWAT
projectShapesfolder.

UponlocatingtheShapefilefolderintheArcSWATproject,...\Watershed\Shapes,severaloptionsare
providedforvisualizationoftheoutletlocation:

45

Thesubbasinboundaries,andthelocationofraingauges.Thismoduleisextremelyusefulinanalyzing
weather the outlets are in their correct location or not, whether the rivers are properly digitized by
SWATornot,iftheoutletisundertheinfluenceofsnowandglacier,intensiveagriculture,etc.

SomeexamplesfromtheEuropeanprojectshow:
(fromhttp://www.sciencedirect.com/science/article/pii/S0022169415001985)

a) Wrong positioning of an outlet on Viar river instead of on the main Rio Guadalquivir in Spain.
The red-green symbol indicates location of the outlet.

46

b) The position of an outlet downstream of a dam on Inn River near Munich, Germany. SWAT
cannot calibrate the flow in this outlet unless the reservoir is modeled.

c) a complex river geometry on Pechora River near Golubovo in Russia. SWAT cannot be
expected to simulate the flow in this outlet with high accuracy.

47

d) The flow in the outlet below is governed by glacier melt near Martigny in Switzerland. These
features could explain some of the discrepancies between simulation and observed results in
SWAT calibration.

16.Utilityprograms(C:\SWAT\SWATCUP5.1.6.2\ExternalData\utilityprograms)

This module currently has two program in it: Make_ELEV_BAND, not shown in the interface, and
Upstreamsubbasins,whichisshownintheinterface.
Make_ELEV_BAND, this program can calculate the elevation band for a SWAT project and use SWAT
CUPtoputtheinformationinSWAT*.subfiles.Thereisanexplanatoryfilecalledelev_band.doc,which
explainshowtodothis.

48

Upstreamsubbasins,thisprogramcandetermine theupstreamsubbasins.Thisisa useful information


for parameterization. A READ_ME.txt file explains how to use this program. The file
upstream_sorted.out, which is not shown in the interface shows, in a sorted manner, all the above
subbasinsofanyobservedsubbasin.Theupstream.outcontainsavisualizationoptionthatshowswhich
outletsareconnectedtoeachother.

Theabovetextandvisualaidshowthatsubbasin(oroutlet)number1hasnoupstreamsubbasin,while
outlets3,7,18(whichareheremeasuredoutlets)haveupstreamsubbasins.Ifyourightclickonthenode
connectingoutlets3and18above,thenyouwillfindallthenonintersectingsubbasinsbetween3and
18.Thatmeansallthesubbasinsbetween3and18.Usingthisinformation,onecancalibrateforoutlet
18byparameterizingsubbasin19and20first,whichcontributetooutlet18.Thenkeeptherangesfixed
fortheparametersofsubbasins18and19,andparameterizesubbasinsinbetween18and3(seethe
picturebelow,thearrowshowsalistoftheseparametersinthetextform).Usingthisprocedure,outlet
3canbecalibrated.

49

17.IterationsHistory
Alliterationscanbesavedintheiterationhistory.Thisallowsstudyingtheprogresstoconvergence.

After a complete iteration, review the suggested new parameters in the new_pars.txt, copy them to
par_inf.txtandeditthemasexplainedbefore,andmakeanewiteration.Therearenohardrulesasto
whenacalibrationprocesscanbeterminated.Buttheprocesscanstopwhensatisfactorystatisticsare
achievedandtherearenofurtherimprovementsintheobjectivefunctionvalue.

50

ParameterizationinSWATCUP
Thefollowingschemecanbeusedtoparameterize,orregionalizeparametersofawatershed.InSWAT,
the HRU is the smallest unit of spatial disaggregation. As a watershed is divided into HRUs based on
elevation,soil,andlanduse,adistributedspatialparametersuchashydraulicconductivity,bulkdensity,
orCN2canpotentiallybedefinedforeachHRU.Ananalystis,hence,confrontedwiththedifficulttask
of collecting or estimating a large number of input parameters, which are usually not available. An
alternativeapproachfortheestimationofdistributedparametersistolumpthembasedonsoiltype,
landuse type, location, slope, or a combination of these. They can then be calibrated using a single
globalmodificationtermthatcanscaletheinitialestimatesbyamultiplicative,oranadditiveterm.This
leadstothefollowingproposedparameteridentifiersexplainedbelow.

x__<parname>.<ext>__<hydrogrp>__<soltext>__<landuse>__<subbsn>__<slope>
Where
x__ =Identifiercodetoindicatethetypeofchangetobeappliedtotheparameter:

v__meanstheexistingparametervalueistobereplacedbyagivenvalue,

a__meansagivenvalueisaddedtotheexistingparametervalue,and

r__meansanexistingparametervalueismultipliedby(1+agivenvalue).
Note:thattherearealwaystwounderscores__aftertheidentifier

<parname>

= SWAT parameter name as it appears in the SWAT I/O manual or in the


Absolute_SWAT_Values.txtfile.

<ext>

= SWAT file extension code for the file containing the parameter
(e.g.,.sol,.hru,.rte,etc.)

<hydrogrp>

=(optional)soilhydrologicalgroup(A,B,CorD)

<soltext>

=(optional)soiltextureasitappearsintheheaderlineofSWATinputfiles

<landuse>

=(optional)nameofthelandusecategoryasitappearsintheheaderlineofSWAT
inputfiles

<subbsn>

= (optional) subbasin number(s) as it appears in the header line of SWAT input


files

<slope>=

(optional)slopeasitappearsintheheaderlineofSWATinputfiles

Anycombinationoftheabovefactorscanbeusedtodescribeaparameteridentifier.Iftheparameters
are used globally, the identifiers <hydrogrp>, <soltext>, <landuse>, <subbsn>, and <slope> can be
omitted.
Note:thetwounderscoresaftereverypreviousspecificationsmustbeused,i.e.,tospecifyonlythe
subbasinwemustwriteeightunderscoresafter.crp v__USLE_C.crp________2

51

The presented encoding scheme allows the user to make distributed parameters dependent on
importantinfluentialfactorssuchas:hydrologicalgroup,soiltexture,landuse,elevation,andslope.The
parameters can be assigned and calibrated regionally, or be changed globally. This gives the analyst
largerfreedominselectingthecomplexityofadistributedparameterscheme.Byusingthisflexibility,a
calibrationprocesscanbestartedwithasmallnumberofparametersthatonlymodifyagivenspatial
pattern, with more complexity and regional resolution added in a stepwise learning process. Some
examplesoftheparameterizationschemeisasfollows:

SpecificationofSoilParameters
Parameteridentifiers

Description

r__SOL_K(1).sol

KofLayer1ofallHRUs

r__SOL_K(1,2,46).sol

KofLayer1,2,4,5,and6ofallHRUs

r__SOL_K().sol

KofAlllayersandallHRUs

r__SOL_K(1).sol__D

Koflayer1ofHRUswithhydrologicgroupD

r__SOL_K(1).sol____FSL

Koflayer1ofHRUswithsoiltextureFSL

r__SOL_K(1).sol____FSL__PAST

Koflayer1ofHRUswithsoiltextureFSLand
landusePAST

r__SOL_K(1).sol____FSL__PAST__13

Koflayer1ofsubbasin1,2,and3withHRUs
containingsoiltextureFSLandlandusePAST

SpecificationofManagementParameters
Parameteridentifiers

Description

v__HEAT_UNITS{rotationno,operationno}.mgt

Managementparametersthatare
subjecttooperation/rotationmust
havebothspecified

v__CNOP{[],1}.mgt

Thischangesanoperation's
parametersinallrotations

v__CNOP{2,1,plant_id=33}.mgt

ChangesCNOPforrotation2,
operation1,andplant33only

v__CNOP{[],1,plant_id=33}.mgt

Similartoabove,butforallrotations

v__CNOP{[],1,plant_id=33}.000010001.mgt

Withthiscommandyoucanonly
modifyonefile

52

r__FRT_KG{9,1}.mgt
r__FRT_KG{9,1,PLANT_ID=12}.mgt

Inthesethreeexamples,rotation9,
operation1,andtherestarefilters
where,meansAND

r__FRT_KG{9,1,PLANT_ID=12,HUSC=0.15}.mgt

SpecificationofCropParameters
Parameteridentifiers

Description

v__T_OPT{30}.CROP.DAT

ParameterT_OPTforcropnumber30inthe
crop.datfile

v__PLTNFR(1){3}.CROP.DAT

Nitrogenuptakeparameter#1forcrop
number3incrop.datfile

SpecificationofPesticideParameters
Parameteridentifiers

Description

v__WSOL{1}.pest.dat

ThischangesparameterWSOLforpesticide
number1inpest.datfile

SpecificationofPrecipitationandTemperatureParameters
Parameteridentifiers

Description

v__precipitation(1){1977300}.pcp1.pcp

(1)meanscolumnnumber1inthepcpfile
{1977300}specifiesyearandday

v__precipitation(13){1977300}.pcp1.pcp

(13)meanscolumn1,2,and3
{1977300}specifiesyearandday

v__precipitation(){1977300,1977301}.pcp

()meansallcolumns(allstations)
{1977300,1977301}means1977days300and
301

v__precipitation(){1977001
1977361,19780011978365,1979003}.pcp

v__MAXTEMP(1){1977001}.tmp1.tmp

()meansallcolumns
fromday1today361of1977,andfromday1
today365of1978,andday3of1979
(1)meanscolumn1inthetmp1.tmpfile

53

{1977001}specifiesyearandday
v__MAXTEMP(2){1977002
1977007}.tmp1.tmp
v__MINTEMP(){19770021977007}.tmp1.tmp

(2)meanscolumn2inthetmp1.tmpfile
fromday2today7in1977
()meansallcolumnsintmp1.tmpfile

SpecificationofslopeParameters
Parameteridentifiers

Description

v__SOL_K(1).sol______________010

Koflayer1forHRUswithslope010

Pleasenotethatbrackets()areusedtodistinguishlayersinparametersthathavemanylayers.
Also,pleasenotethatprecipitationandtemperaturearealsoallowedtobeusedasfittingparameters.
Thisoptionmustbeusedwithcautionbecausefittingrainfallcanmakecalibrationofparameters
irrelevantasrainfallisthesinglemostimportantdrivingvariablecontrollingthebehaviorofflow.

54

ObjectiveFunctionDefinition

Intheobserved.txtfile,10differentobjectivefunctionsarecurrentlyallowed.Theseinclude:

1=mult

Minimize:

Qs i

nQ

S s i

nS

N s i

* ....

nN

ThisisamultiplicativeformofthesquareerrorwhereQ,S,andNstandforvariables(e.g.,discharge,
sediment,andnitrate),nisthenumberofobservations,andmandsstandformeasuredandsimulated.
Sometimesthedenominatorisdividedby1000tokeepgsmall.

n1

2=sum

Minimize:

n2

n3

g w1 Qm Qs i w2 S m S s i w3 N m N s i .....
2

i 1

i 1

i 1

ThisisthesummationformofthesquareerrorwhereQ,S,andNstandforvariables(e.g.,discharge,
sediment,andnitrate),mandsstandformeasuredandsimulated,nisthenumberofdatapoints,and
weightswscouldbecalculatedas:
i) w j 1

n j j

where j isthevarianceofthejthmeasuredvariable(seeAbbaspour,etal.,2001),or
2

ii) w1 1,

w2

Qm
Sm

w3

Qm
Nm

where bars indicate averages (see Abbaspour et al., 1999). Note that choice of weighs can affect the
outcomeofanoptimizationexercise(seeAbbaspour,etal.,1997).

3=R2

Maximize:

Qm ,i Qm Qs ,i Qs
i

R2
2
2
Qm,i Qm Qs,i Qs
i

CoefficientofdeterminationR2whereQisavariable(e.g.,discharge),andm andsstandformeasured
and simulated, i is the ith measured or simulated data. If there are more than one variable, then the
objectivefunctionisdefinedas:

55

g w j R 2j
j

Wherewjistheweightofjthvariable.

4=Chi2

Minimize:

Q
i

Qs i

m2

whereQisavariable(e.g.,discharge),andmandsstandformeasuredandsimulated,respectively,and
m2 isthevarianceofmeasureddata.Iftherearemorethanonevariable,thentheobjectivefunctionis
calculateas:

g w j 2j
j

Wherewj istheweightofjthvariable.

Q m Q s i

5=NS

Maximize:

NS 1

Qm,i Q m

NashSutcliffe (1970), where Q is a variable (e.g., discharge), and m and s stand for measured and
simulated, respectively, and the bar stands for average. If there is more than one variable, then the
objectivefunctionisdefinedas:

g w j NS j
j

Wherewj istheweightofjthvariable.

6=bR

Maximize:

b R 2
1 2
b R

if
if

b 1
b 1

Where Coefficient of determination R2 is multiplied by the coefficient of the regression line between
measuredandsimulateddata,b.Thisfunctionallowsaccountingforthediscrepancyinthemagnitude
oftwosignals(depictedbyb)aswellastheirdynamics(depictedbyR2).Ifmorethanonevariable,the
objectivefunctionisexpressedas(Krauseetal.,2005):

56

incaseofmultiplevariables,gisdefinedas:

g w j j
j

Wherewj istheweightofjthvariable.

7=SSQR

Minimize:

whereQisavariable(e.g.,discharge),andmandsstandformeasuredandsimulated,respectively.Here
irepresentstherank.TheSSQRmethodaimsatfittingthefrequencydistributionsoftheobservedand
the simulated series. After independent ranking of the measured and the simulated values (van
GriensvenandBauwens,2003):
incaseofmultiplevariables,gisdefinedas:

g w j SSQR j
j

Wherewj istheweightofjthvariable.

8.PBIAS

Minimize:

PBIAS 100 *

i 1

Qs i

Q
i 1

m,i

where Q is a variable (e.g., discharge), and m and s stand for measured and simulated, respectively.
Percent bias measures the average tendency of the simulated data to be larger or smaller than the
observations. The optimum value is zero, where low magnitude values indicate better simulations.
Positive values indicate model underestimation and negative values indicate model over estimation
(Guptaetal.,1999).
incaseofmultiplevariables,gisdefinedas:

g w j PBIAS j
j

Wherewj istheweightofjthvariable.

57

9.KGE
Where

Maximize:
,and

,andristhelinearregressioncoefficientbetweensimulatedandmeasured

variable, s and m are means od simulated and measured data, and s and m are the standard
deviationofsimulatedandmeasureddata.KlingGuptaefficiency(Guptaetal.,2009).
incaseofmultiplevariables,gisdefinedas:

g w j KGE j
j

Wherewj istheweightofjthvariable.

10.RSR

Minimize:

RSR

Qs i

m ,i

Qm

i 1
n

i 1

whereQisavariable(e.g.,discharge),andmandsstandformeasuredandsimulated,respectively.RSR
isthestandardizestheRMSEusingtheobservationstandarddeviation.RSRisquitesimilartoChiin4.It
variesfrom0tolargepositivevalues.ThelowertheRSRthebetterthemodelfit(Moriasietal.,2007).
incaseofmultiplevariables,gisdefinedas:

g w j RSR j
j

Wherewj istheweightofjthvariable.

11.MNS

Maximize:

NS 1

Qs i

m,i

Qm

p
i

Modified NaschSutcliffe efficiency factor. If p=2, then this is simply NS as in 5 above. If p=1, the
overestimationofapeakisreducedsignificantly.Themodifiedformisreportedtobemoresensitiveto
significantoverorunderpredictionthanthesquareform.Increasingthevalueofpbeyond2resultsin
anincreaseinthesensitivitytohighflowsandcouldbeusedwhenonlythehighflowsareofinterest,
e.g.forfloodprediction(Krauseetal.,2005)
NOTE:Afteraniteration,trychangingthetypeofobjectivefunctionandrunSUFI2Post.bataloneto
see the effect of different objective functions, without having to run SWAT again. This is quite
informativeasitshowshowthechoiceofobjectivefunctionaffectsthecalibrationsolution.

58

SensitivityAnalysis
1GlobalSensitivityanalysis
Parameter sensitivities are determined by calculating the following multiple regression system, which
regresses the Latin hypercube generated parameters against the objective function values (in file
goal.txt):
m

g i bi
i 1

A ttest is then used to identify the relative significance of each parameter bi. The sensitivities given
above are estimates of the average changes in the objective function resulting from changes in each
parameter, while all other parameters are changing. This gives relative sensitivities based on linear
approximations and, hence, only provides partial information about the sensitivity of the objective
functiontomodelparameters.Inthisanalysis,thelarger,inabsolutevalue,thevalueoftstat,andthe
smallerthepvalue,themoresensitivetheparameter.Intheexamplebelow,CN2,ESCO,followedby
GE_DELAY,CH_N2,andALPHA_BFarethefivemostsensitiveparameters.

59

tstatandpvalue
Amultipleregressionanalysisisusedtogetthestatisticsofparametersensitivity.Thetstatis
thecoefficientofaparameterdividedbyitsstandarderror.Itisameasureoftheprecisionwith
whichtheregressioncoefficientismeasured.Ifacoefficientislargecomparedtoitsstandard
error,thenitisprobablydifferentfrom0andtheparameterissensitive.Whatislarge?
YoucouldcomparethetstatofaparameterwiththevaluesintheStudent'stdistributiontable
todeterminethepvalue,whichisthenumberthatyoureallyneedtobelookingat.The
Student'stdistribution(youfindattheendofmoststatisticsbook)describeshowthemeanof
asamplewithacertainnumberofobservationsisexpectedtobehave.Thepvalueforeach
termteststhenullhypothesisthatthecoefficientisequaltozero(noeffect).Alowpvalue(<
0.05)indicatesthatyoucanrejectthenullhypothesis.Inotherwords,apredictorthathasa
lowpvalueislikelytobeameaningfuladditiontoyourmodelbecausechangesinthe
predictor'svaluearerelatedtochangesintheresponsevariable.Conversely,alargerpvalue
suggeststhatchangesinthepredictorarenotassociatedwithchangesintheresponse.Sothat
parameterisnotverysensitive.Apvalueof<0.05isthegenerallyacceptedpointatwhichto
rejectthenullhypothesis(i.e.,thecoefficientofthatparameterisdifferentfrom0).Withap
valueof0.05,thereisonlya5%chancethatresultsyouareseeingwouldhavecomeupina
randomdistribution,soyoucansaywitha95%probabilityofbeingcorrectthatthevariableis
havingsomeeffect.

2Oneatatimesensitivityanalysis
Oneatatime sensitivity shows the sensitivity of a variable to the changes in a parameter if all other
parametersarekeptconstantatsomevalue.Theproblemhereisthatweneverknowwhatthevalueof
thoseotherconstantparametersshouldbe.Thisisanimportantconsiderationasthesensitivityofone
parameterdependsonthevalueofotherparameters.

y1

Q
P1

Variable, Q

y2

x1

x2

P2

Theaboveexampleillustratesthispoint.IfvalueofparameterP1iskeptconstantaty1,thensmall
changesisparameterP2makesignificantchangesinvariableQ,indicatingthatP2isquiteasensitive
parameter.WhileifthevaluesofparameterP1iskeptconstantaty2value,thenchangesinparameter
P2aroundx2willgivetheimpressionthatP2isnotasensitiveparameterasthevariabledoesnotchange

60

bymuch.Therefore,thevaluesofthefixedparametersmakeadifferencetothesensitivityofa
changingparameter.

Toperformtheoneatatimesensitivityanalysis:
1DoasshowninthefollowingFigure.SetthenumberofparametersinthePar_inf.txtfileto1,and
performaminimumof3simulations.

2ThensetthevaluesoffileSUFI2_swEdit.defasfollows:

3FinallyperformtheiterationbyrunningunderCalibration,SUFI2_pre.batandthenSUFI2_run.bat.
4Now,thethreesimulationcanbevisualizedforeachvariablebyexecutingoneatatimecommand
underSensitivityanalysisasshownbelow:

61

ThedashedlineistheobservationandthedischargesignalforFLOW_OUT_1isplottedforthreevalues
ofCN2withinthespecifiedrange.Clearly,CN2issensitiveandneedstohavelargervalues.
NOTE:TheusersmustbeawarethattheparametersintheSWATfilesinthemainSWATCUPproject
directoryarealwayschanging.Onceyouperformasensitivityiteration,thentheparametervaluesin
thosefilesarethevaluesofthelastrun(lastparameterset)ofthelastiteration.Toperformtheoneat
atimesensitivityanalysis,oneshouldsetthevaluesoftheparametersthatarekeptconstanttosome
reasonablevalues.Thesereasonablevaluescould,forexample,bethebestsimulation(simulationwith
thebestobjectivefunctionvalue)ofthelastiteration,ortheinitialmodelparametersthatresideinthe
Backupdirectory.

62

ParallelProcessing
Parallel processing is a licensed product. Its function is to speed up the calibration process by
parallelizingtherunsinSUFI2.Thespeedoftheparallelprocessingdependsonthecharacteristicsofthe
computer.Newlaptopsnowhaveatleast4CPUs.Theparallelprocessingmodulecanutilizeall4CPUs
sothata1000runiterationcanbedividedinto4simultaneousrunsof250eachperCPU.Thespeedup
willnotbe4timesbecauseofprogramandWindowsoverheads;but therunwithparallelprocessing
willbesubstantiallyfasterthanasingle1000runsubmission.
Nowadaysitispossibletobuildquiteinexpensivelyacomputerwith48to64CPUsandmorethan96
GBofRAM.MostSWATmodelsofanydetailcouldberunonsuchmachineswithouttheneedforcloud
orgridcomputing(seeRouholahnejad,etal.,2012formoredetail).
Currently, 20 simulations are allowed to be made without the need for a license. To obtain a license
follow the direction under license and activation and send the hardware ID, for the time being, to
(neprach_sale@yahoo.com).Afterobtainingalicensefilebyemail,followtheactivationprocess.
Torunparallelprocessing,simplyclicktheParallelProcessingbuttononthecommandbar.Anewsetof
command icons appear. Press parallel Processing to see how many jobs can be submitted to your
computer.UnderProcesscountyoucanchoosehowmanyparalleljobsyouwanttosubmitIfthesize
oftheprojectislargeandthereisnotenoughmemory,thensmallernumberofparallelprocessesthan
thenumberofCPUsmaybepossible.TheCalibrationiconworksasbefore.

63

ValidationinSUFI2
Forvalidation,youshouldusethecalibratedparameterrangeswithoutanyfurtherchangesandrun
aniteration(withthesamenumberofsimulationsasyouusedforcalibration).
ToperformvalidationinSUFI2,editthefilesobserved_rch.txt,observed_hru.txt,obsrved_sub.txt,and
observed.txt asnecessaryforthevalidationperiod.Also,theextractionfiles and thefile.ciotoreflect
thevalidationperiod.Thensimplyusethecalibratedparameterrangestomakeonecompleteiteration
(usingthecalibrationbutton).The95PPUandtheSummary_statfileshouldreflectthevalidationresults.
Thevalidationkeybringsupthefollowingmenu,whichexplainsthevalidationsteps.

64

Thesequenceofprogramexecution
Thesequenceofprogramexecutionandinput/outputsareshowninbelow.Inthefollowing,eachinput
andoutputfileisdescribedindetail.
INPUTFILES

OUTPUTFILES

- SUFI2.IN\\trk.txt
- SUFI2.IN\\par_inf.txt

SUFI2_LH_sample.exe

-ECHO\\echo_LH_sample.txt
-SUFI2.IN\\par_val.txt
-SUFI2.IN\\str.txt

- SUFI2.IN\\trk.txt
- SUFI2.IN\\par_inf.txt
- SUFI2.IN\\par_val.txt

SUFI2_make_input.exe

-Echo\echo_make_par.txt
-model.in

- model.in
- Absolute_SWAT_Values.txt
- BACKUP file

-New SWAT parameter files


-Swat EditLog.txt

SWAT_Edit.exe

SUFI2_Run.bat
-SWAT output files

SWAT.exe

- SUFI2_Extract_*.def
- output.*

- SUFI2.IN\var_file_*.txt

-Echo\echo_extract_*.txt
-SUFI2.OUT\files listed in
var_file_*.txt

SUFI2_Extract_*.exe

- SUFI2.IN\trk.txt

- SUFI2.IN\observed

*.txt

- extract_*_No_Obs.def

- output.*

- SUFI2.IN\var_file_*_No_obs.txt
- SUFI2.IN\trk.txt

SUFI2_Extract_*_No_obs.exe

- SUFI2.IN\observed.txt

SUFI2_goal_fn.exe

- SUFI2.IN\\var_file_name.txt

- SUFI2.IN\par_inf.txt
- Files liste in var_file_name.txt
- SUFI2.IN\observed.txt
- SUFI2.IN\\best_sim.txt

-Echo\echo_95ppu.txt
-SUFI2.OUT\95ppu.txt
-SUFI2.OUT\\95ppu_g.txt
-SUFI2.OUT\\summary_stat.txt

SUFI2_95ppu.exe

- SUFI2.IN\par_inf.txt
-SUFI2.OUT\\no_beh_sims.txt

- Files liste in var_file_name.txt


- SUFI2.IN\observed.txt
- SUFI2.IN\\best_sim.txt

NO_Observation

-Echo\echo_goal_fn.txt
-SUFI2.OUT\\goal.txt
-SUFI2.OUT\best_sim.txt
-SUFI2.OUT\\best_par.txt
-SUFI2.OUT\\beh_pars.txt
-SUFI2.OUT\\no_beh_sims.txt
-SUFI2.OUT\best_sim_nr.txt

- SUFI2.IN\par_inf.txt

- SUFI2.IN\par_val.txt

SUFI2.OUT\files listed in
var_file_*_No_obs.txt

SUFI2_Post.bat

-Echo\echo_95ppu_beh.txt
-SUFI2.OUT\\summary_stat.txt

SUFI2_95ppu_beh.exe

SUFI2.IN\observed.txt
SUFI2.OUT\\goal.txt

SUFI2.OUT\\best_par.txt

Echo\new_pars_all.txt
SUFI2.OUT\new_pars.txt

SUFI2_new_pars.exe

- 95ppu_No_Obs.def
- SUFI2.IN\par_inf.txt

SUFI2.OUT\95ppu_No_Obs.txt
SUFI2.OUT\95ppu_g_No_Obs.txt

95ppu_No_Obs.exe

65

Howtoseetheresultsofmyinitialmodel?
BeforestartingiterationsinSWATCUP,youshouldchecksimulationofyourinitialmodelsetup.Itis
assumedthatsomethoughtandinvestigationhasgoneintodatacollectionandthebestinformationis
usedtobuildtheSWATmodel.Tochecktheinitial(default)simulationofyourmodelinSWATCUPdo
thefollowing:
1InPar_inf,putthenumberofsimulationsandthenumberofparametersto1andsetupadummy
parameterchangesuchas

r__SFTMP.bsn

(thisdoesnotchangeanything)

2InSUFI2_swEditputthebeginningandtheendingsimulationalsoto1
3Thenexecute:Pre,Run,andPostprocessing.
Nowlookatthe95PPUresultofyourdefaultorinitialmodelrun.Ifsimulationsandobservationsaretoo
different,thenyouneedtotakeacloserlookatyourswatmodel,includingrainfall,etc.
Iftheyarenottoodifferent,thenforeachoutletadjustrelevantparametersintherelevantsubbasins
(referredtoasparameterization),anddoafewiterationsbasedonthat.
Foraprotocolseetheopenaccesspaper:
http://www.sciencedirect.com/science/article/pii/S0022169415001985

HowtosettheparametersinSWATtextfilestothebestparametervaluesof
thelastiteration?
IfyouwanttheSWATTxtInOutfilesreflectthebestparametersyouobtainedinaniterationdothe
following:
1NotethenumberofthebestsimulationintheSummary_Stat.txtfile
2IntheSUFI2_swEdit.txtsetthestartingandendingsimulationvaluesbothtothenumberofthebest
simulationinstep1.
3UnderCalibration,runSUFI2_run.bat.DonotrunSUFI2Pre.bat.
Thiscommandwillreplacetheparametervaluesandsetthemtothebestvaluesofthelastiteration.

66

HowtodoLatinHypercubeSampling
ThebatchfileSUFI2_pre.batrunstheSUFI2_LH_sample.exeprogram,whichgeneratesLatinhypercube
samples.Thesesamplesarestoredinpar_val.txtfile.
ThisprogramusesLatinhypercubesamplingtosamplefromtheparameterintervalsgiveninpar_inf.txt
file. The sampled parameters are given in par_val.txt file, while the structure of the sampled data is
writtentostr.txtjustforinformation.Ifthenumberofsimulationsis3,thenthefollowinghappens:
1)Parameters(say2)aredividedintotheindicatednumberofsimulations(say3)

3
3

2)Parametersegmentsarerandomized

3)Asampleistakenatthemiddleofeverysegment

Everyverticalcombinationisthenaparameterset.

67

HowtoCalibratemorethanoneVariable
Ifyouwanttocalibrateusing,forexampledischarge,nitrate,andphosphate,youshouldfirstcalibrate
fordischarge.Thisisbecauseflowisthemaincontrollingvariable.Aftercalibratingforflow,keepflow
parameterrangesasyouobtainedfromflowcalibrationandaddsedimentparameters.Therearetwo
typesofsedimentparameters,thosethataffectonlysediment,andthosethataffectflowandsediment.
SeetheTablebelowfromAbbaspouretal.,(2007).

Initially, add the parameters that only affect sediment and run an iteration. You should get the same
dischargeresultsasbefore,sotrycalibratingonlyforthesedimentparametersthatdontaffecttheflow

68

first.After,oneortwoiterations,ifsedimentresultsarenotsatisfactory,thenaddtheotherparameters
thataffectsedimentandflowanddoacoupleofiterationsbyallowingflowparameterstoalsochange
slightly.
ForNitraterepeatthesameprocedurewithnitrateparameters.Notethatforcalibratingphosphoryou
mustcalibrateforsedimentfirst,becausemuchofthephosphormoveswithsediment,butnitratecan
becalibratedwithoutsediment.

Itisimportanttoalsonotethatthesolutiontothecalibratedmodelisthe95PPUgeneratedby
theparameterranges.DONOTtrytoonlyusethebestparametersetforfurtheranalysis.By
doing this you are assuming that the calibrated model only has one solution and this is not
correct. It is never correct to assume that only one set of parameters can represent a
watershed, which was modeled by very uncertain information about soil, landuse, climate,
management, measured data used for calibration, etc. Always propagate the range of
parametersyouobtainedduringcalibrationforallpurposesofmodeluse.

69

PSO

ParticleSwarmOptimization

70

IntroductiontoPSO
Particleswarmoptimization(PSO)isapopulationbasedstochasticoptimizationtechniquedevelopedby
Dr.EberhartandDr.Kennedyin1995,inspiredbysocialbehaviorofbirdflockingorfishschooling.
PSOsharesmanysimilaritieswithevolutionarycomputationtechniquessuchasGeneticAlgorithms(GA).
The system is initialized with a population of random solutions and searches for optima by updating
generations. However, unlike GA, PSO has no evolution operators such as crossover and mutation. In
PSO, the potential solutions, called particles, fly through the problem space by following the current
optimumparticles.Thedetailedinformationwillbegiveninfollowingsections.
Compared to GA, the advantages of PSO are that PSO is easy to implement and there are few
parameterstoadjust.PSOhasbeensuccessfullyappliedinmanyareas:functionoptimization,artificial
neuralnetworktraining,fuzzysystemcontrol,andotherareaswhereGAcanbeapplied.
There are two popular swarm inspired methods in computational intelligence areas: Ant colony
optimization (ACO)and particleswarm optimization (PSO). ACO wasinspired bythebehaviorsofants
and
has
many
successful
applications
in
discrete
optimization
problems.
(http://iridia.ulb.ac.be/~mdorigo/ACO/ACO.html)
Theparticleswarmconceptoriginatedasasimulationofsimplifiedsocialsystem.Theoriginalintentwas
to graphically simulate the choreography of bird of a bird block or fish school. However, it was found
that
particle
swarm
model
can
be
used
as
an
optimizer.
(http://www.engr.iupui.edu/~shi/Coference/psopap4.html)

Thealgorithm
Asstatedbefore,PSOsimulatesthebehaviorsofbirdflocking.Supposethefollowingscenario:agroup
of birds are randomly searching food in an area. There is only one piece of food in the area being
searched. All the birds do not know where the food is. But they know how far the food is in each
iteration.Sowhat'sthebeststrategytofindthefood?Theeffectiveoneistofollowthebirdwhichis
nearesttothefood.
PSOlearnsfromthescenarioandusesittosolvetheoptimizationproblems.InPSO,eachsinglesolution
is a "bird" in the search space. We call it "particle". All of particles have fitness values which are
evaluated by the fitness function to be optimized, and have velocities which direct the flying of the
particles.Theparticlesflythroughtheproblemspacebyfollowingthecurrentoptimumparticles.
PSOisinitializedwithagroupofrandomparticles(solutions)andthensearchesforoptimabyupdating
generations.Ineveryiteration,eachparticleisupdatedbyfollowingtwo"best"values.Thefirstoneis
the best solution (fitness) it has achieved so far. (The fitness value is also stored.) This value is called
pbest.Another"best"valuethatistrackedbytheparticleswarmoptimizeristhebestvalue,obtainedso
farbyanyparticleinthepopulation.Thisbestvalueisaglobalbestandcalledgbest.Whenaparticle
takespartofthepopulationasitstopologicalneighbors,thebestvalueisalocalbestandiscalledlbest.
After finding the two best values, the particle updates its velocity and positions with the following
equations(a)and(b).
v[]=v[]+c1*rand()*(pbest[]present[])+c2*rand()*(gbest[]present[])

(a)

71

present[]=persent[]+v[]

(b)
v[]istheparticlevelocity,persent[]isthecurrentparticle(solution).pbest[]andgbest[]aredefinedas
statedbefore.rand()isarandomnumberbetween(0,1).c1,c2arelearningfactors.usuallyc1=c2=2.
Thepseudocodeoftheprocedureisasfollows:
Foreachparticle

Initializeparticle
END
Do

Foreachparticle

Calculatefitnessvalue

Ifthefitnessvalueisbetterthanthebestfitnessvalue(pBest)inhistory

setcurrentvalueasthenewpBest

End

ChoosetheparticlewiththebestfitnessvalueofalltheparticlesasthegBest

Foreachparticle

Calculateparticlevelocityaccordingequation(a)

Updateparticlepositionaccordingequation(b)
End
Whilemaximumiterationsorminimumerrorcriteriaisnotattained
Particles' velocities on each dimension are clamped to a maximum velocity Vmax. If the sum of
accelerations would cause the velocity on that dimension to exceed Vmax, which is a parameter
specifiedbytheuser,thenthevelocityonthatdimensionislimitedtoVmax.

ComparisonsbetweenGeneticAlgorithmandPSO
Mostofevolutionarytechniqueshavethefollowingprocedure:
1.Randomgenerationofaninitialpopulation
2.Reckoningofafitnessvalueforeachsubject.Itwilldirectlydependonthedistancetotheoptimum.
3.Reproductionofthepopulationbasedonfitnessvalues.
4.Ifrequirementsaremet,thenstop.Otherwisegobackto2.
Fromtheprocedure,wecanlearnthatPSOsharesmanycommonpointswithGA.Bothalgorithmsstart
withagroupofarandomlygeneratedpopulation,bothhavefitnessvaluestoevaluatethepopulation.
Bothupdatethepopulationandsearchfortheoptimumwithrandomtechniques.Bothsystemsdonot
guaranteesuccess.
However,PSOdoesnothavegeneticoperatorslikecrossoverandmutation.Particlesupdatethemselves
withtheinternalvelocity.Theyalsohavememory,whichisimportanttothealgorithm.
Compared with genetic algorithms (GAs), the information sharing mechanism in PSO is significantly
different.InGAs,chromosomesshareinformationwitheachother.Sothewholepopulationmoveslike
aonegrouptowardsanoptimalarea.InPSO,onlygBest(orlBest)givesouttheinformationtoothers.It
isaonewayinformationsharingmechanism.Theevolutiononlylooksforthebestsolution.Compared
withGA,alltheparticlestendtoconvergetothebestsolutionquicklyeveninthelocalversioninmost
cases.

7.OnlineResourcesofPSO
ThedevelopmentofPSOisstillongoing.AndtherearestillmanyunknownareasinPSOresearchsuchas
themathematicalvalidationofparticleswarmtheory.

72

Onecanfindmuchinformationfromtheinternet.Followingaresomeinformationyoucangetonline:
http://www.particleswarm.net lots of information about Particle Swarms and, particularly, Particle
SwarmOptimization.LotsofParticleSwarmLinks.
http://icdweb.cc.purdue.edu/~hux/PSO.shtml lists an updated bibliography of particle swarm
optimizationandsomeonlinepaperlinks
http://www.researchindex.com/youcansearchparticleswarmrelatedpapersandreferences.
References:
http://www.engr.iupui.edu/~eberhart/
http://users.erols.com/cathyk/jimk.html
http://www.alife.org
http://www.aridolan.com
http://www.red3d.com/cwr/boids/
http://iridia.ulb.ac.be/~mdorigo/ACO/ACO.html
http://www.engr.iupui.edu/~shi/Coference/psopap4.html
Kennedy,J.andEberhart,R.C.Particleswarmoptimization.Proc.IEEEint'lconf.onneuralnetworksVol.
IV,pp.19421948.IEEEservicecenter,Piscataway,NJ,1995.
Eberhart,R.C.andKennedy,J.Anewoptimizerusingparticleswarmtheory.Proceedingsofthesixth
international symposium on micro machine and human science pp. 3943. IEEE service center,
Piscataway,NJ,Nagoya,Japan,1995.
Eberhart,R.C.andShi,Y.Particleswarmoptimization:developments,applicationsandresources.Proc.
congressonevolutionarycomputation2001IEEEservicecenter,Piscataway,NJ.,Seoul,Korea.,2001.
Eberhart,R.C.andShi,Y.Evolvingartificialneuralnetworks.Proc.1998Int'lConf.onneuralnetworks
andbrainpp.PL5PL13.Beijing,P.R.China,1998.
Eberhart, R. C. and Shi, Y. Comparison between genetic algorithms and particle swarm optimization.
Evolutionary programming vii: proc. 7th ann. conf. on evolutionary conf., SpringerVerlag, Berlin, San
Diego,CA.,1998.
Shi, Y. and Eberhart, R. C. Parameter selection in particle swarm optimization. Evolutionary
ProgrammingVII:Proc.EP98pp.591600.SpringerVerlag,NewYork,1998.
Shi, Y. and Eberhart, R. C. A modified particle swarm optimizer. Proceedings of the IEEE International
ConferenceonEvolutionaryComputationpp.6973.IEEEPress,Piscataway,NJ,1998

73

GLUE
GeneralizedLikelihoodUncertaintyEstimation

74

IntroductiontotheProgramGLUE
AshortsummaryoftheGLUE(BevenandBinley,1992)conceptisgivenbelow.Formoreinformation
thereadersarereferredtotheGLUEliteratureandtheInternet.
The Generalized Likelihood Uncertainty Estimation (GLUE) (Beven and Binley, 1992) was introduced
partlytoallowforthepossiblenonuniqueness(orequifinality)ofparametersetsduringtheestimation
of model parameters in overparameterized models. The procedure is simple and requires few
assumptions when used in practical applications. GLUE assumes that, in the case of large over
parameterized models, there is no unique set of parameters, which optimizes goodnessof fitcriteria.
The technique is based on the estimation of the weights or probabilities associated with different
parameter sets, based on the use of a subjective likelihood measure to derive a posterior probability
function, which is subsequently used to derive the predictive probability of the output variables. In
Romanowiczetal.,(1994)astatisticallymotivated,moreformalequivalentofGLUEisdeveloped,where
thelikelihoodfunctionisexplicitlyderivedbasedontheerrorbetweentheobservedoutputsandthose
simulated by the model. This formal approach is equivalent to a Bayesian statistical estimation: it
requires assumptions about the statistical structure of the errors. GLUE is usually applied by directly
likelihoodweightingtheoutputsofmultiplemodelrealizations(deterministicorstochastic,definedby
sets of parameter values within one or more model structures) to form a predictive distribution of a
variable of interest. Prediction uncertainties are then related to variation in model outputs, without
necessarily adding an additional explicit error component. There is thus an interesting question as to
whether an appropriate choice of likelihood measure can produce similar results from the two
approaches.
Thereareanumberofpossiblemeasuresofmodelperformancethatcanbeusedinthiskindofanalysis.
TheonlyformalrequirementsforuseinaGLUEanalysisarethatthelikelihoodmeasureshouldincrease
monotonouslywithincreasingperformanceandbezeroformodelsconsideredasunacceptableornon
behavioral.Applicationorientedmeasuresareeasilyusedinthisframework.Measuresbasedonformal
statistical assumptions, when applied to all model realizations (rather than simply in the region of an
optimal model) should give results similar to a Bayesian approach when used within a GLUE
framework (Romanowicz et al., 1994), but the assumptions made (additive Gaussian errors in the
simplestcases)arenotalwayseasilyjustifiedinthecaseofnonlinearenvironmentalmodelswithpoorly
knownboundaryconditions.

AGLUEanalysisconsistsofthefollowingthreesteps:
1)Afterthedefinitionofthegeneralizedlikelihoodmeasure L( ) ,alargenumberofparametersets
are randomly sampled from the prior distribution and each parameter set is assessed as either
behavioral or nonbehavioral through a comparison of the likelihood measure with the given
thresholdvalue.
2)Eachbehavioralparameterisgivenalikelihoodweightaccordingto:

wi

L( i )

L(
k 1

(1)

whereNisthenumberofbehavioralparametersets.
3)Finally,thepredictionuncertaintyisdescribedaspredictionquantilefromthecumulativedistribution
realizedfromtheweightedbehavioralparametersets.
Inliterature,themostfrequentlyusedlikelihoodmeasureforGLUEistheNashSutcliffecoefficient
(NS),whichisalsousedintheGLUE06program:

75

NS 1

(y
ti 1

M
ti

() y ti ) 2

(y
ti 1

ti

y)

(2)

wherenisthenumberoftheobserveddatapoints,and y ti and ytMi () representstheobservationand


model simulation with parameter at time ti, respectively, and y is the average value of the
observations.

76

CouplingofGLUEtoSWATCUP
SWATCUP is an interface to facilitate the coupling between external system analysis tools and SWAT
model.ThefollowingdiagramillustratestheGLUESWATCUPlinks.InterfaceofGLUEandSWATCUPis
asfollows:

Glue06.def

Glue06.exe

model.in

SWAT inputs

SWAT_Edit.exe

backup dir

SWAT.exe

SWAT outputs

glue_extract_rch.def

GLUE_extract_rch.exe

model.out

else

if max simulations reached

GLUE_95ppu.exe

exit

77

ValidationofGLUE
After calibration, validation can be performed by using the Validate option from the menu. Before
executing validation, however, the GLUE_obs.dat file must be edited to contain validation data,
GLUE_Extract_rch.def must be edited to extract validation data, and SWATs File.cio and climate files
(pcp.pcpetc.)mustcoverthevalidationperiodasindicatedinthewindowthatappearswhenvalidation
isexecuted.ThevalidationprogramusesthebehavioralparametersonlytorunSWAT.

InputfilesofGLUEaredescribedbelow.Theyareformostpartsselfexplanatory.

78

FileDefinition

glue06.def
Line

parameter

value

Remark

//comment

MaxSimulation

10000

Thelarger,thebetter!

ParDefFile

glue_par.def

parameterdefinitionfile

ObjfunThresh

0.3

Thresholdvaluegivenbythe
usertoseparatethe
behaviouralparametersfrom
thenonbehavioural
parameters

Percentile

0.025

Thepercentileusedtocalculate
thequantilesofbehavioural
modelresultsinline14

ModelInFile

model.in

outputofglue06.exe,andthe
inputofSWAT_Edit.exe

ModelOutFile

model.out

outputof
GLUE_extract_rch.exeand
inputofglue06.exe

ModelCmd

glue_run.cmd

BachfileexecutedduringGLUE
run

ModelObjfunFile

glue_obs.dat

IfthefirstparameterisF,
thenthesecondparameteris
theobserveddatafilenameand
NashSutcliffeistheobjective
function.

IfthefirstparameterisT,
thenthesecondparameteris
theobjectivefunctionfilename
thatmustbecalculatedand
providedbytheuser

10

ModelParaSet

modelpara.out

Theoutputfilenameforall
sampledparametersets

79

11

ModelBehParaset

modelpara.beh

Theoutputfilenameforthe
behaviouralparametersets

12

ModelResult

modelres.out

Theoutputfilenameforallthe
modelresults

13

ModelBehResult

modelres.beh

Theoutputfilenameforthe
behaviouralmodelresults

14

ModelResQaunt

modelquant.out

Theoutputfilenameforthe
quantilesofbehaviouralmodel
results

80

ParaSol

ParameterSolution

81

IntroductiontotheProgramParaSol
AshortsummaryoftheParaSol(VanGriensvenandMeixner,2006)conceptisgivenbelow.Formore
informationthereadersarereferredtotheAPPENDIX,theliteratureandtheInternet.

The ParaSol method aggregates objective functions (OFs) into a global optimization criterion
(GOC), minimizes these OFs or a GOC using the Shuffle Complex (SCEUA) algorithm and performs
uncertaintyanalysiswithachoicebetween2statisticalconcepts.TheSCEalgorithmisaglobalsearch
algorithm for the minimization of a single function for up to 16 parameters (Duan et al., 1992). It
combinesthedirectsearchmethodofthesimplexprocedurewiththeconceptofacontrolledrandom
search of Nelder and Mead (1965), a systematic evolution of points in the direction of global
improvement,competitiveevolution(Holland,1975)andtheconceptofcomplexshuffling.Inafirststep
(zeroloop), SCEUA selects an initial population by random sampling throughout the feasible
parameters space for p parameters to be optimized (delineated by given parameter ranges). The
population is portioned into several complexes that consist of 2p+1 points. Each complex evolves
independently using the simplex algorithm. The complexes are periodically shuffled to form new
complexesinordertoshareinformationbetweenthecomplexes.

SCEUAhasbeenwidelyusedinwatershedmodelcalibrationandotherareasofhydrologysuch
as soil erosion, subsurface hydrology, remote sensing and land surface modeling (Duan, 2003). It was
generally found to be robust, effective and efficient (Duan, 2003). The SCEUA has also been applied
with success on SWAT for the hydrologic parameters (Eckardt and Arnold, 2001) and hydrologic and
waterqualityparameters(vanGriensvenandBauwens,2006).TheprocedureofParaSolis:
1) After the optimization of the modified SCEUA, the simulations performed are divided into good
simulationsandnotgoodsimulationsbyathresholdinthiswaysimilartotheGLUEmethodology,and
accordingly,goodparametersetsandnotgoodparameterset.UnlikeGLUE,thethresholdvaluecan
be defined by either the 2statistics where the selected simulations correspond to the confidence
region(CR)orBayesianstatisticsthatareabletopointoutthehighprobabilitydensityregion(HPD)for
theparametersorthemodeloutputs.
2)Thepredictionuncertaintyishenceconstructedequallyfromthegoodsimulations.
TheObjectivefunctionusedinParaSolisSumofthesquaresoftheresiduals(SSQ):
n

SSQ ( y tMi () y ti ) 2

(3)

ti 1

82

CouplingParaSoltoSWATCUP
ThedataflowbetweenprogramParaSolandSWATCUPisasshownbelow.

ParaSol.in

ParaSol.exe

model.in

SWAT inputs

backup dir

SWAT_Edit.exe

SWAT.exe

SWAT outputs

ParaSol_extract_rch.def

ParaSol_extract_rch.exe

model.out

else

if max simulation reached

ParaSol_95ppu.exe

exit

83

StepbystepproceduretorunParaSolinSWATCUP

1)ChooseParaSolprogramtype.
2)EdittheinputfilesinCalibrationFiles
3)ExecuteParaSol2.exeunderCalibrate
4)ExaminetheoutputinCalibrationOutputs.ParaSolalsorequiresalargenumberofruns(>5000)
OutputsofParaSolareinthefollowingfilesinPara_Sol.OUT:
95ppu.out

Containsthe95%predictionuncertaintyofgoodparameter
ParaSol.out

Detailedoutputs
Bestpar.out
Filewiththebestparameterset
Scepar.out

FilewithallparametersetsusedinSCEUAoptimization
Sceobjf.out
FilewithallobjectivefunctionscalculatedduringtheSCEUAoptimization
Scegoc.out
Filewithallobjectivefunctions(standardized)andtheglobaloptimization
criterion(GOC)calculatedduringtheSCEUAoptimization
goodpar.out
FilewithgoodparametersaccordingtoParaSol
scepargoc.out
FilewithallparametersandGOCvaluesduringSCEruns
summary_stat.out
Summarystatisticsofallvariables

VALIDATION
Aftercalibration,validationcanbeperformedbyusingtheValidateoptionfromthemenu.Before
executingvalidation,however,theParaSol_obs.datfilemustbeeditedtocontainvalidationdata,
ParaSol_Extract_rch.defmustbeeditedtoextractvalidationdata,andSWATsFile.cioandclimatefiles
(pcp.pcpetc.)mustcoverthevalidationperiod.Thevalidationprogramusesthegoodparametersonly
torunSWAT.

84

ParaSol:optimizationanduncertaintyanalysistool
AnnvanGriensvenandTomMeixner

ParaSolfiles:
File
ParaSol.exe
ParaSol.f
ParaSol.in
Simple_model.exe
Simple_model.f
Batchprogram.bat
Input4.
Model.in
Model.out

description
Executableforwindows
FortrancodesforParaSol.exe
InputfileforParaSol.exe
Executableforexamplemodelinwindows
FortrancodesforSimple_model.exe
Batchfilethatcallsimple_model.exe
Rainfallinputsforsimple_model.exe
Inputfileforsimple_model.exe(EAWAG
protocol)
Outputfileofsimple_model.exe(EAWAG
protocol)

Introduction
PSSGisatoolthatperformsanoptimizationanduncertaintyanalysisformodeloutputs.Inincorporates
twomethods:ParaSol(ParameterSolutions)thatallowsfortheoptimizationofmodelparametersbased
on SCEUA algorithm (Duan et al., 1992) and uses the simulations to assess confidence ranges on
parametersandoutputs(vanGriensvenandMeixner,2003a).

DescriptionoftheParaSolmethod
The ParaSol method aggregates objective functions (OFs) into a global optimization criterion (GOC),
minimizes these OFs or a GOC using the SCEUA algorithm and performs uncertainty analysis with a
choicebetween2statisticalconcepts.

TheShuffledcomplexevolution(SCE)algorithm
TheSCEalgorithmisaglobalsearchalgorithmfortheminimizationofasinglefunctionforupto16
parameters[Duanetal.,1992].Itcombinesthedirectsearchmethodofthesimplexprocedurewiththe
conceptofacontrolledrandomsearchofNelderandMead[1965],asystematicevolutionofpointsin
thedirectionofglobalimprovement,competitiveevolution[Holland,1975]andtheconceptofcomplex
shuffling. In a first step (zeroloop), SCEUA selects an initial population by random sampling
throughout the feasible parameters space for p parameters to be optimized (delineated by given
parameter ranges). The population is portioned into several complexes that consist of 2p+1 points.
Each complex evolves independently using the simplex algorithm. The complexes are periodically
shuffledtoformnewcomplexesinordertoshareinformationbetweenthecomplexes.

85

SCEUA has been widely used in watershed model calibration and other areas of hydrology such as
soil erosion, subsurface hydrology, remote sensing and land surface modeling (Duan, 2003). It was
generally found to be robust, effective and efficient (Duan, 2003). The SCEUA has also been applied
with success on SWAT for the hydrologic parameters (Eckardt and Arnold, 2001) and hydrologic and
waterqualityparameters(vanGriensvenandBauwens,2003).

Objectivefunctionstobeused
Within an optimization algorithm it is necessary to select a function that must be minimized or
optimizedthatreplacestheexpertperceptionofcurvefittingduringthemanualcalibration.Therearea
widearrayofpossibleerrorfunctionstochoosefromandmanyreasonstopickoneversusanother(for
some discussions on this topic see [Legates and McCabe, 1999; Gupta et al., 1998]). The types of
objectivefunctionsselectedforParaSolarelimitedtothefollowingdueto thestatisticalassumptions
madeindeterminingtheerrorboundsinParaSol.
Sum of the squares of the residuals (SSQ): similar to the Mean Square Error method (MSE) it aims at
matchingasimulatedseriestoameasuredtimeseries.

SSQ

i 1, n

xi , simulated

i , measured

(1)

with n the number of pairs of measured (xmeasured) and


simulated(xsimulated)variables
Thesumofthesquaresofthedifferenceofthemeasuredandsimulatedvaluesafterranking(SSQR):The
SSQRmethodaimsatthefittingofthefrequencydistributionsoftheobservedandthesimulatedseries.
Afterindependentrankingofthemeasuredandthesimulatedvalues,newpairsareformedandthe
SSQRiscalculatedas
SSQR

j 1, n

j , measured

x j , simulated

(2)

wherejrepresentstherank.
AsopposedtotheSSQmethod,thetimeofoccurrenceofagivenvalueofthevariableisnotaccounted
forintheSSQRmethod(vanGriensvenandBauwens,2003).

Multiobjectiveoptimization
Since the SCEUA minimizes a single function, it cannot be applied directly for multiobjective
optimization.Althoughthereareseveralmethodsavailableinliteraturetoaggregateobjectivefunctions
to a global optimization criterion (Madsen, 2003; van Griensven and Bauwens, 2003), they do not
foreseefurtherapplicationofuncertaintyanalysis.

86

AstatisticallybasedaggregationmethodisfoundwithintheBayesiantheory(1763).Byassumingthat
theresidualshaveanormaldistributionN(0,2),thevarianceisestimatedas
2

SSQ MIN

nobs

(3)

withSSQMINthesumofthesquaresattheoptimumandnobsthenumberofobservations(BoxandTiao,
1973):.Theprobabilityofaresidualforagivenparametersetdependsonaspecifictimeseriesofdata
andcanthenbecalculatedas:

p( | y t ,obs )

y t , sim y t ,obs 2

exp
2 2

2 2

(4)

(5)

(6)

(7)

or

yt , sim y t ,obs 2

p( | yt ,obs ) exp
2 2

foratimeseries(1..T)thisgives

p( | Yobs )

yt , sim y t ,obs 2

exp

2 2

t 1

2
2

or
T

y yt ,obs 2
t 1 t , sim
p ( | Yobs ) exp

2
2

ForacertaintimeseriesYobstheprobabilityoftheparametersetp(|Yobs)isthusproportionalto
SSQ1
p( | Yobs ) exp
2
2 * 1

(8)

whereSSQ1arethesumofthesquaresoftheresidualswithcorrespondingvariance1foracertaintime
series.For2objectives,aBayesianmultiplicationgives:

SSQ1
SSQ2
p( | Yobs) C1* exp
* exp

2
2
2 *1
2 * 2

(9)

87

Applyingequation(3),(9)canbewrittenas:
SSQ1 * nobs1
SSQ2 * nobs2
p ( | Yobs ) C 2 * exp
* exp

SSQ
SSQ2, min

1, min

(10)

(11)

Inaccordanceto(10),itistruethat:
ln p( | Yobs ) C 3

SSQ 2 * nobs 2 SSQ 2 * nobs 2

SSQ 2 min
SSQ 2, min

Wecanthusoptimizeormaximizetheprobabilityof(11)byminimizingaGlobalOptimizationCriterion
(GOC)thatissettotheequation:
GOC

SSQ1 * nobs1
SSQ 2 * nobs 2

SSQ1, min
SSQ 2, min

(12)

(13)

Withequation(11),theprobabilitycanberelatedtotheGOCaccordingto:
p ( | Yobs ) exp GOC

Thesumofthesquaresoftheresidualsgetthusweightsthatareequaltothenumberofobservations
dividedbytheminimum.Theminimaoftheindividualobjectivefunctions(SSQorSSQR)arehowever
initially not known. After each loop in the SCEUA optimization, an update is performed for these
minima of the objective functions using the newly gathered information within the loop and in
consequence,theGOCvaluesarerecalculated.
Themainadvantageofusingequation12tocalculatetheGOCisthatitallowsforaglobaluncertainty
analysisconsideringallobjectivefunctionsasdescribedbelow.

Uncertaintyanalysismethod
TheuncertaintyanalysisdividesthesimulationsthathavebeenperformedbytheSCEUAoptimization
intogoodsimulationsandnotgoodsimulationsandinthiswayissimilartotheGLUEmethodology
[Beven and Binley, 1992]. The simulations gathered by SCEUA are very valuable as the algorithm
samples over the entire parameter space with a focus of solutions near the optimum/optima. To
increasetheusefulnessoftheSCEUAsamplesforuncertaintyanalysis,someadaptationsweremadeto
theoriginalSCEUAalgorithm,topreventbeingtrappedinalocalizedminimumandtoallowforabetter
explorationofthefullparameterrangeandpreventthealgorithmfromfocusingonaverynarrowsetof
solutions.Themostimportantmodificationsare:
1. Aftereachloop,themworstresultsarereplacedbyrandomsamplingthischangepreventsthe
method from collapsing around a local minimum (where m is equal to the number of
complexes). Similarly, Vrugt et al. (2003) solved this problem of collapsing in the minimum by
introducingrandomness.Herehowever,therandomnesswasintroducedforthereplacementof
thebestresults.
2. WhenparametervaluesareunderorovertheparameterrangedefinedbySCEUA,theygeta
valueequaltotheminimumboundormaximumboundinsteadofarandomsampledvalue.

88

The ParaSol Algorithm uses two techniques to divide the sample population of SCEUA into good
andbadsimulations.Bothtechniquesarebasedonathresholdvaluefortheobjectivefunction(or
globaloptimizationcriterion)toselectthegoodsimulationsbyconsideringallthesimulationsthatgive
anobjective functionbelowthis threshold.The thresholdvalue canbedefinedby 2statisticswhere
the selected simulations correspond to the confidence region (CR) or Bayesian statistics that are able
pointoutthehighprobabilitydensityregion(HPD)fortheparametersorthemodeloutputs(figure1).

2method
ForasingleobjectivecalibrationfortheSSQ,theSCEUAwillfindaparameterset*consistingofthe
p free parameters (*1, *2, *p), that corresponds to the minimum of the sum the square SSQ.
According to 2 statistics (Bard, 1974), we can define a threshold c for good parameter set using
equation
c OF ( *) * (1

2 p , 0.95
)

n p

(14)

wherebythe2p,0.95getsahighervalueformorefreeparametersp.
For multiobjective calibration, the selections are made using the GOC of equation (12) that
normalizesthesumofthesquaresforn,equaltothesumofnobs1andnobs2,observation.Athreshold
fortheGOCiscalculatedby:
c GOC( *) * (1

2 p ,0.95
nobs1 nobs2 p

(15)

thusallsimulationswithGOC<Xgocmin+aredeemedacceptable

Bayesianmethod
AccordingtotheBayesiantheorem,theprobabilityp(|Yobs)ofaparametersetisproportionalto
equation(11).
After normalizing the probabilities (to ensure that the integral over the entire parameter space is
equalto1)acumulativedistributionscanbemadeandhencea95%confidenceregionscanbedefined.
Astheparameterssetswerenotsampledrandomlybutweremoredenselysampledneartheoptimum
duringSCEUAoptimisation,itisnecessarytoavoidhavingthedenselysampledregionsdominatethe
results.Thisproblemispreventedbydeterminingaweightforeachparametersetibythefollowing
calculations:
1. Dividingthepparameterrangeinmintervals
2. Foreachintervalkoftheparameterj,thesamplingdensitynsamp(k,j)iscalculatedbysummingthe
timesthattheintervalwassampledforaparameterj.
Aweightforaparametersetiisthanestimatedby
1. Determinetheintervalk(between1andm)oftheparameteri
2. Considerthenumberofsampleswithinthatinterval=nsamp(k,j)

89

3. Theweightisthancalculatedas

1/ p

W (i ) nsamp(k , j )
j 1i

Thecthresholdisdeterminedbythefollowingprocess:
a.SortparametersetsandGOCvaluesaccordingtodecreasingprobabilities
b.Multiplyprobabilitiesbyweights
c.NormalizetheweightedprobabilitiesbydivisionusingPTwith
T

PT W ( ) *p( | Y )

i 1

obs

(16)

(17)

d. Sum normalized weighted probabilities starting from rank 1 till the sum gets higher than the
cumulativeprobabilitylimit(95%or97.5%).TheGOCcorrespondingtoorclosesttotheprobabilitylimit
definesthecthreshold.

sce sampling

Xi-squared CR

Bayesian HPD

200

Smax

150
100

Figure 2: Confidence region CR for the 2statistics and high probability density (HPD)
region for the Bayesian statistics for a 2parameter test model

50
0
0.0

0.2

0.4

0.6

0.8

1.0

UsingParaSol
ItusesaninputfileParaSol.in.Itoperatesbycommunicatingtothemodelthroughinputandoutput
files.Inputofthemodelisprintedinmodel.inthatcontainesthenewparametervalues.Thereare2
optionstocommunicatewiththeoutput:
1. modelof.outwiththeobjectivefunctionsOR
2. model.outwiththeoutputvaluesanddata.obswiththeobservedvalues.
Foroption2,themodelwillcalculateobjectivefunctionsbasedonequation1.
ParaSol.exeisprogrammedtorunabatchfileprogrambatch.bat,containingthenecessarycommands
fortheexecutionofthefollowing:
1. readingtheparameterslistedinmodel.inandchangingthemodelinputfilesforthese
parametersvalues.
2. runningtheprogram
3. readingoutputoftheprogramandprintingtheobjectivefunction(s)intoamodelof.outfilein
therightformat(ififlag>0)

TheParaSOlpackagecontainsanexamplefortheapplication(simple_model.exe)thatisacontainsa
modelwith2parametersec[0,200]andek[0,1],havinganoptimumattheparameterset(100,0.3).

90

simple_model.exeperformsthe3previouslymentionedtasksandiscalledfromtheinthe
programbatch.batfile.

ForrunningPSSGonanotherapplicationsotherapplication.exe,itisthusnecessary:

1. TocreatetheappropriateParaSol.infile,listingallparameters(upto100)andrangestobe
consideredandindicatingthenumberofobjectivefunctionstoconsider(upto40)
2. Havingaprogramchangeinputs.exethatchangestheinputfilesforotherapplication.exe
accordingtothevaluesinParaSol.in
3. Havingaprogrammakeobjf.exethatwillreadtheoutputsofotherapplication.exe,
calculatestheobjectivefunctionsandwritesthesetothefilemodelof.out(orwritesthe
model.outfilewithsimulationsaccordingtotheEAWAGformatincaseofiflag=0).
4. Putthecommandschangeinputs.exe,otherapplication.exeandmakeobjf.exe(ififlag>0)in
theprogrambatch.datfile.

CHANGEPAR
Thissectionfollowstheprevioussection.Eachparameterhasonerow,containinglowerlimit,upper
limit,andtheparametername(upto250digits),allinfreeformat.

Outputfiles

Filename
Description
ParaSol.out
Detailedoutputs.
Bestpar.out
Filewiththebestparameterset
Scepar.out
Sceobj.out
Scegoc.out
goodpar.out
scepargoc.out

FilewithallparametersetsusedinSCEUAoptimization
FilewithallobjectivefunctionscalculatedduringtheSCE
UAoptimization
Filewithallobjectivefunctions(standardized)andthe
GOCcalculatedduringtheSCEUAoptimization
FilewithgoodparametersaccordingtoParaSol
Filewithallparametersandgocvaluesduringsceruns.

Rerunthemodelwithgoodparametersets
ThisoptiononlymakessenseifyouhaveyourmodeloutputaccordingtotheEAWAGprotocol.Ifyou
putISTEP=2intheParaSol.infile,themodelwillrerunallthegoodparametersets(ingoodpar.out)and
calculatetheminimumandmaximumboundsforthemodeloutput(inmodel.out).Thesemimimumand
maximumvalueswillweprintedinthefilesmodelminval.outandmodelmaxval.outrespectively.

91

MCMC

MarkovChainMonteCarlo

92

IntroductiontoMCMC
MCMCgeneratessamplesfromarandomwalkwhichadaptstotheposteriordistribution(Kuczeraand
Parent,1998).ThesimplesttechniquefromthisclassistheMetropolisHastingalgorithm(Gelmanetal.
1995), which is applied in this study. A sequence (Markov Chain) of parameter sets representing the
posteriordistributionisconstructedasfollows:
1)Aninitialstartingpointintheparameterspaceischosen.
2) A candidate for the next point is proposed by adding a random realization from a symmetrical
jumpdistribution, f jump ,tothecoordinatesofthepreviouspointofthesequence:

k*1 k rand ( f jump )

(13)

3)Theacceptanceofthecandidatepointsdependsontheratior:

f post Y ( *k 1 y meas )
f post Y ( k y meas )

(14)

Ifr>=1,thenthecandidatepointisacceptedasanewpointwithprobabilityr.Ifthecandidatepointis
rejected,thepreviouspointisusedasthenextpointofthesequence.
Inordertoavoidlongburninperiods(orevenlackofconvergencetotheposteriordistribution)the
chainisstartedatanumericalapproximationtothemaximumoftheposteriordistributioncalculated
withtheaidoftheshuffledcomplexglobaloptimizationalgorithm(Duanetal.,1992).

93

StepbysteprunningofMCMC

TheMCMCinSWATCUPisbasedontheproceduresdevelopedbyPeterReichertintheUNCSIMpackage.Formoredetailwereferthereaderto
http://www.uncsim.eawag.ch/.TorunMCMCthefollowinginputfilesmustbecreated:

mcmc.def
Model
External_ModelInFile
External_ModelOutFile
External_ModelExecFile

ParDefFile
PriorDistFile
LikeliDefFile
JumpDistFile
SampSize

ResValFile
ResidValFile
PostMarkovChainParSampFile
PostMarkovChainParQuantFile
PostMarkovChainResSampFile
PostMarkovChainResQuantFile
PostMarkovChainPdfSampFile

External
mcmc.in
mcmc.out
mcmc_run.bat

mcmc_par.def
mcmc_prior.def
mcmc_obs.dat
mcmc_jump.def
100

mcmc_best.out
mcmc_resid.out
mcmc_parsamp.out
mcmc_parquant.out
mcmc_ressamp.out
mcmc_resquant.out
mcmc_pdfsamp.out

//parameterfilegeneratedinternally
//simulationfilecreatedinternally
//batchfiletostartmcmc

//paerrameterdefinitionfiletobepreparedbyuser
//parameterpriorstobepreparedbyuser
//observationfiletobepreparedbyuser
//jumpdistributionfiletobepreparedbyuser
//numberofruntobemadebymcmc

//bestsolution
//residualofbestsolution
//MarkovChainofparameters
/quantilesofparameterdistribution
//MarkovChainofresult
//quantileofMarkovChainresiduals
//MarkovChainofpdfofposterior

94

mcmc_par.def
Name
Value
Minimum Maximum Scale
UncRange Increment
r__CN2.mgt
0.37213
0.8
0.2
0.3
0.03
0.03
r__ALPHA_BF.gw
0.32866
0.85
0.2
0.325
0.0325
0.0325
r__GW_DELAY.gw 0.404144
0.2
0.9
0.35
0.035
0.035
r__CH_N2.rte
0.14402
0.8
0.8
1
0.1
0.1
v__CH_K2.rte
6.205686
1
10
5.5
0.55
0.55
........
........
........
........
........
........
........
........
........
........
........
........
........
........
Lamda1
0.5
0
1
1
0.1
0.1
Lamda2
0
0
10
1
0.1
0.1
Std_Dev_Out
1
0.1
10
1
0.1
0.1

Valueinitialestimateofparametervalue
Minimumminimumparametervalue
Maximummaximumparametervalue
Scale
UncRange
IncrementparameterincrementforstepchangesinValuewithinMimimumMaximum
ActSens
ActEstim
Unit
Description

ActSens
T
T
T
T
T
........
........
F
F
F

ActEstim
T
T
T
T
T
........
........
F
F
F

Unit
0.2
0.2
0.9
0.8
10
........
........

Description

95

mcmc_obs.dat
ResCode Dat
Transformation Par_1
Par_2
Dist
Mean Std_Dev
1
21.41 BoxCox
Lamda1
Lamda2
Normal
0 Std_Dev_Out
2
23.943 BoxCox
Lamda1
Lamda2
Normal
0 Std_Dev_Out
3
99.956 BoxCox
Lamda1
Lamda2
Normal
0 Std_Dev_Out
4
100.169 BoxCox
Lamda1
Lamda2
Normal
0 Std_Dev_Out
5
53.057 BoxCox
Lamda1
Lamda2
Normal
0 Std_Dev_Out
6
32.07 BoxCox
Lamda1
Lamda2
Normal
0 Std_Dev_Out
7
9.286 BoxCox
Lamda1
Lamda2
Normal
0 Std_Dev_Out
8
1.784 BoxCox
Lamda1
Lamda2
Normal
0 Std_Dev_Out
9
6.586 BoxCox
Lamda1
Lamda2
Normal
0 Std_Dev_Out
10
11.948 BoxCox
Lamda1
Lamda2
Normal
0 Std_Dev_Out
11
14.812 BoxCox
Lamda1
Lamda2
Normal
0 Std_Dev_Out
12
14.681 BoxCox
Lamda1
Lamda2
Normal
0 Std_Dev_Out
......
16.261 BoxCox
Lamda1
Lamda2
Normal
0 Std_Dev_Out

ResCodelabelofmeasureddatapoints
Datdatavalue
Transformationtransformationtobeperformedonthedata,i.e.,BoxCoxtransformation
Par_1thefirstparameterofthetransformation
Par_2thesecondparameterofthetransformation
Distdistributionofthedatapoint
Meanmeanofthedistributionofthedatapoint
Std_Devstandarddeviationofthedistributionofthedatapint

mcmc_prior.def
Name
Dist
Par_1
Par_2
r__CN2.mgt
Uniform
0.8
0.2
r__ALPHA_BF.gw
Uniform
0.85
0.2
r__GW_DELAY.gw Uniform
0.2
0.9
r__CH_N2.rte
Uniform
0.8
0.8
v__CH_K2.rte
Uniform
1
10
r__SOL_AWC.sol
Uniform
0.2
0.6
.........
.........
.........
.........
.........
.........
.........
.........

Distparameterdistribution
Par_1firstmomentofthedistribution
Par_2secondmomentofthedistribution

96

Preparethemcmc_jump.deffileaccordingtothefollowingformat.Ashortrunmaybenecessary
first,inordertogeneratereasonablenumbers.

mcmc_jump.def

Name
r__CN2.mgt
r__ALPHA_BF.gw
r__GW_DELAY.gw
r__CH_N2.rte
v__CH_K2.rte
r__SOL_AWC.sol

Dist
Normal
Normal
Normal
Normal
Normal
Normal

Par_1
0
0
0
0
0
0

Par_2
0.003
0.00325
0.0035
0.01
0.055
0.002

Nameparametername
Distparameterdistribution
Par_1firstmomentofthedistribution
Par_2secondmomentofdistribution

Thejumpdistributionsarequiteimportanttoconvergenceandrequiresomeinitialtrialanderror
runstospecify.

mcmc_run.bat
SWAT_Edit.exe
//programtoinsertgeneratedparametersinswatinputfiles
swat2005.exe
//swatprogrameitherswat2000orswat2005
MCMC_extract_rch.exe //programtoextractthedesiredoutputsfromswatoutputfiles

7Runtheprogramexecuting mcmc_start.bat
Note:Pleaseignorethefollowingerrorduringtherun:

97

Reference
Abbaspour,K.C.E.Rouholahnejad,S.Vaghefi,R.Srinivasan,B.Klve.2014.Modellinghydrology
and water quality of the European Continent at a subbasin scale: calibration of a high
resolutionlargescaleSWATmodel.JournalofHydrology,524:733752.
http://www.sciencedirect.com/science/article/pii/S0022169415001985
Abbaspour,K.C.,J.Yang,I.Maximov,.,R.Siber,K.Bogner,J.Mieleitner,J.Zobrist,R.Srinivasan.
2007.Modellinghydrologyandwaterqualityintheprealpine/alpineThurwatershedusing
SWAT.JournalofHydrology,333:413430.
Abbaspour,K.C.,2005.Calibrationofhydrologicmodels:whenisamodelcalibrated?InZerger,A.
andArgent,R.M.(eds)MODSIM2005InternationalCongressonModellingandSimulation.
ModellingandSimulationSocietyofAustraliaandNewZealand,December2005,pp.2449
12455.ISBN:0975840029.http://www.mssanz.org.au/modsim05/papers/abbaspour.pdf
Abbaspour,K.C.,Johnson,A.,vanGenuchten,M.Th,2004.Estimatinguncertainflowandtransport
parameters using a sequential uncertainty fitting procedure. Vadose Zone Journal 3(4),
13401352.
Abbaspour,K.C.,R.Schulin,M.Th.VanGenuchten,2001.Estimationofunsaturatedsoilhydraulic
parametersusingantcolonyoptimization.AdvancesinWaterResources,24:827841.
Abbaspour, K. C., M. Sonnleitner, and R. Schulin. 1999. Uncertainty in Estimation of Soil
HydraulicParametersbyInverseModeling:ExampleLysimeterExperiments.SoilSci.Soc.
ofAm.J.,63:501509.
Abbaspour, K. C., M. Th. van Genuchten, R. Schulin, and E. Schlppi. 1997. A sequential
uncertainty domain inverse procedure for estimating subsurface flow and transport
parameters.WaterResour.Res.,v.33,no.8.,pp.18791892.
Arnold, J.G., Srinivasan R., Muttiah R.S., Williams J.R., 1998. Large area hydrologic modeling and
assessment Part 1: Model development. Journal of the American Water Resources
Association34(1),7389.
Bard,1974.NonLinearParameterEstimation.AcademicPress,NewYorkN.Y.
Box, G.E.P., and G.C.Tiao. Bayesian Inference in Statistical Analysis, AddisonWesleyLongman,
Reading,Mass,1973.
Beven, K. and Freer, J., 2001. Equifinality, data assimilation, and uncertainty estimation in
mechanistic modelling of complex environmental systems using the GLUE methodology.
JournalofHydrology,249(14):1129.
Beven, K. and Binley, A., 1992. The Future of Distributed Models Model Calibration and
UncertaintyPrediction.HydrologicalProcesses,6(3):279298.
Duan, Q., Global Optimization for Watershed Model Calibration, in Calibration of Watershed
Models,editedbyQ.Duan,H.V.Gupta,S.Sorooshian,A.N.Rousseau,andR.Turcotte,pp.
89104,AGU,Washington,DC,2003.
Duan,Q.,V.K.Gupta,andS.Sorooshian,Effectiveandefficientglobaloptimizationforconceptual
rainfallrunoffmodels,Water.Resourc.Res.,28:10151031,1992.
Duan,Q.,S.Sorooshian,H.V.Gupta,A.N.Rousseau,andR.Turcotte,AdvancesinCalibrationof
WatershedModels,AGU,Washington,DC,2003.
Eckhardt K and J.G. Arnold. Automatic calibration of a distributed catchment model. , J. Hydrol.,
251:103109.2001.
Faramarzi,M.,K.C.Abbaspour,H.Yang,R.Schulin.2008.ApplicationofSWATtoquantifyinternal
renewablewaterresourcesinIran.HydrologicalSciences.DOI:10.1002/hyp.7160.
Gelman,S.,Carlin,J.B.,Stren,H.S.,Rubin,D.B.,1995.BayesianDataAnalysis,ChapmanandHall,
NewYork,USA.

98

Gupta, H. V., S. Sorooshian, and P. O. Yapo, 1998. Toward improved calibration of hydrologic
models: multiple and noncommensurable measures of information, Water. Resourc. Res.,
34:751763.
Gupta,H.V.,S.Sorooshian,andP.O.Yapo.1999.Statusofautomaticcalibrationforhydrologic
models:Comparisonwithmultilevelexpertcalibration.J.HydrologicEng.,4(2):135143
Gupta,H.V.,Kling,H.,Yilmaz,K.K.,Martinez,G.F.2009.Decompositionofthemeansquarederror
and NSE performance criteria: implications for improving hydrological
modelling.J.Hydrol.377,8091.
Holland, J.H. AdaptationinNaturalandArtificialSystems.TheUniversityof MichiganPress,Ann
Arbor,MI,183p,975,1975.
Hornberger,G.M.andSpear,R.C.,1981.AnApproachtothePreliminaryAnalysisofEnvironmental
Systems.JournalofEnvironmentalManagement,12(1):718.
Krause, P., D.P. Boyle, F. Bse, 2005. COmparison of different efficiency criteria for hydrological
modelassessment,Adv.InGeoscheices,5:8997.
Kuczera, G., Parent, E., 1998. Monte Carlo assessment of parameter uncertainty in conceptual
catchmentmodels:theMetropolisalgorithm.JournalofHydrology,211(14):6985.
Legates, D. R. and G. J. McCabe, 1999. Evaluating the use of "goodnessoffit" measures in
hydrologicandhydroclimaticmodelvalidation.Water.Resou.Res.,35:233241.
Madsen, H., Parameter estimation in distributed hydrological catchment modelling using
automatic calibration with multiple objectives. Advances in water resources, 26, 205216,
2003.
Marshall, L., D. Nott, and A. Sharma 2004. A comparative study of Markov chain Monte Carlo
methods for conceptual rainfallrunoff modeling. Water Resources Research, 40, W02501,
doi:10.1029/2003WR002378.
McKay, M.D., Beckman, R. J., Conover, W.J., 1979. A comparison of three methods for selecting
valuesofinputvariablesintheanalysisofoutputfromacomputercode.Technometrics.21,
239245.
Moriasi, D.N., Arnold, J.G., Van Liew, M.W., Bingner, R.L., Haemel, R.D., Veith, T.L. 2007. Model
evaluation guidelines for systematic qualification of accuracy in watershed simulation.
TransactionsoftheASABE,50:885900.
Nash,J.E.,J.V.Sutcliffe,1970.RiverFlowForecastingthroughConceptualModels1.ADiscussion
ofPrinciples.JournalofHydrology10(3),282290.
Nelder,J.A.,R.A.Mead,simplexmethodforfunctionminimization,ComputerJournal,7,308313,
1965.
Press, W.H., Flannery, B.P., Teukolsky, S.A., Vetterling, W.T., 1992. Numerical Recipe, The Art of
ScientificComputation.2nded.CambridgeUniversityPress,Cambridge,GreatBritain.
Romanowicz,R.J.,BevenK.,andTawnJ.1994.EvaluationofPredictiveUncertaintyinNonlinear
HydrologicalModelsUsingaBayesianApproach.In:StatisticsfortheEnvironment2,Water
RelatedIssues,edsV.BarnettandK.F.Turkman,297315,Wiley,Chichester.
RouholahnejadE,AbbaspourKC,VejdaniM,SrinivasanR,SchulinR,LehmannA.2012.
Parallelizationframeworkforcalibrationofhydrologicalmodels,EnvironmentalModelling
Software,31:2836.
Schuol,J.,K.C.Abbaspour,R.Srinivasan,andH.Yang.2008a.ModellingBlueandGreenWater
AvailabilityinAfricaatmonthlyintervalsandsubbasinlevel.WaterResourcesResearch.VOL.
44,W07406,doi:10.1029/2007WR006609.
Schuol,J.,Abbaspour,KC.,Sarinivasan,R.,Yang,H.2008b.Estimationoffreshwateravailabilityin
the West African Subcontinent using the SWAT hydrologic model. Journal of Hydroloy.
352(12):3049.

99

van Griensven A. and W. Bauwens. 2003. Multiobjective autocalibration for semidistributed


waterqualitymodels,Water.Resourc.Res.39(12):Art.No.1348DEC16.
VanGriensven,A.,Meixner,T.,2006.Methodstoquantifyandidentifythesourcesofuncertainty
forriverbasinwaterqualitymodels.WaterScienceandTechnology,53(1):5159.
Vrugt, J. A., H. V. Gupta, W. Bouten, and S. Sorooshian. 2003. A shuffled Complex Evolution
MetropolisAlgorithmforEstimatingPosteriorDistributionofWatershedModelParameters,
inCalibrationofWatershedModels,ed.Q.Duan,S.Sorooshian,H.V.Gupta,A.N.Rousseau,
andR.Turcotte,AGUWashingtonDC,DOI:10.1029/006WS07.
Yang,J.,Reichert,P.,Abbaspour,K.C.,Yang,H.,2007.HydrologicalModellingoftheChaoheBasin
in China: Statistical Model Formulation and Bayesian Inference. Journal of Hydrology, 340:
167182.
Yang, J., Abbaspour K. C., Reichert P., and Yang H. 2008. Comparing uncertainty analysis
techniquesforaSWATapplicationtoChaoheBasininChina.Inreview.JournalofHydrology.
358(12):123.
Yapo, P. O., Gupta, H.V., Sorooshian, S., 1998. Multiobjective global optimization for hydrologic
models.J.ofHydrol.204,8397.

100

You might also like