ProgramType         {algorithm}
ObjectiveFunction   GCOP
ModelExecutable     ./ostrich-runs-raven.sh
PreserveBestModel   ./save_best.sh
#OstrichWarmStart   yes

ModelSubdir processor_

BeginExtraDirs
model
#best
EndExtraDirs

BeginFilePairs
  raven-hbv-ec.rvp.tpl;  raven-hbv-ec.rvp
  raven-hbv-ec.rvh.tpl;  raven-hbv-ec.rvh
  raven-hbv-ec.rvt.tpl;  raven-hbv-ec.rvt
  #can be multiple (.rvh, .rvi)
EndFilePairs

#Parameter/DV Specification
BeginParams
  #parameter      init.    low      high    tx_in  tx_ost  tx_out   # in HBV called
  par_x01         random   {lowerBounds.par_x01}  {upperBounds.par_x01}  none   none     none    TT
  par_x02         random   {lowerBounds.par_x02}  {upperBounds.par_x02}  none   none     none    CFMAX
  par_x03         random   {lowerBounds.par_x03}  {upperBounds.par_x03}  none   none     none    CFR
  par_x04         random   {lowerBounds.par_x04}  {upperBounds.par_x04}  none   none     none    CWH
  par_x05         random   {lowerBounds.par_x05}  {upperBounds.par_x05}  none   none     none    par_x5 = FC/par_x21
  par_x06         random   {lowerBounds.par_x06}  {upperBounds.par_x06}  none   none     none    LP
  par_x07         random   {lowerBounds.par_x07}  {upperBounds.par_x07}  none   none     none    BETA
  par_x08         random   {lowerBounds.par_x08}  {upperBounds.par_x08}  none   none     none    PERC
  par_x09         random   {lowerBounds.par_x09}  {upperBounds.par_x09}  none   none     none    K1
  par_x10         random   {lowerBounds.par_x10}  {upperBounds.par_x10}  none   none     none    K2
  par_x11         random   {lowerBounds.par_x11}  {upperBounds.par_x11}  none   none     none    MAXBAS
  par_x12         random   {lowerBounds.par_x12}  {upperBounds.par_x12}  none   none     none    PCALT
  par_x13         random   {lowerBounds.par_x13}  {upperBounds.par_x13}  none   none     none    TCALT
  par_x14         random   {lowerBounds.par_x14}  {upperBounds.par_x14}  none   none     none    saturation at the wilting point
  par_x15         random   {lowerBounds.par_x15}  {upperBounds.par_x15}  none   none     none    ALPHA
  par_x16         random   {lowerBounds.par_x16}  {upperBounds.par_x16}  none   none     none    maximum interflow rate for capillary rise
  par_x17         random   {lowerBounds.par_x17}  {upperBounds.par_x17}  none   none     none    thickness of top soil layer
  par_x18         random   {lowerBounds.par_x18}  {upperBounds.par_x18}  none   none     none    melt correction factor (forest)
  par_x19         random   {lowerBounds.par_x19}  {upperBounds.par_x19}  none   none     none    release from glacier as it melts
  par_x20         random   {lowerBounds.par_x20}  {upperBounds.par_x20}  none   none     none    RFCF
  par_x21         random   {lowerBounds.par_x21}  {upperBounds.par_x21}  none   none     none    SFCF
EndParams

BeginTiedParams
  # par_1_+_x15 = 1.0 + par_x15
  # Xtied = (c1 * X1) + c0
  # --> c0 = 1.0
  # --> c1 = 1.0
  #
  par_1_+_x15 1 par_x15 linear 1.00 1.00 free
  #
  # par_half_x11 = par_x11 * 0.5
  # Xtied = (c1 * X) + c0
  # --> c0 = 0.0
  # --> c1 = 0.5
  #
  par_half_x11 1 par_x11 linear 0.5 0.0 free
EndTiedParams

BeginResponseVars
  #name   filename                              keyword         line    col     token
  NS      ./model/output/{run_name}-{run_index}_Diagnostics.csv;       OST_NULL        1       3       ','
EndResponseVars

BeginTiedRespVars
  NegNS 1 NS wsum -1.00
EndTiedRespVars

BeginGCOP
  CostFunction NegNS
  PenaltyFunction APM
EndGCOP

BeginConstraints
        # not needed when no constraints, but PenaltyFunction statement above is required
        # name     type     penalty    lwr   upr   resp.var
EndConstraints

# Randomsed control added
{random_seed}

#Algorithm should be last in this file:

BeginDDSAlg
        PerturbationValue 0.20
        MaxIterations {max_iterations}
        UseRandomParamValues
        # UseInitialParamValues
        # above intializes DDS to parameter values IN the initial model input files
EndDDSAlg
