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

ModelSubdir processor_

BeginExtraDirs
model
#best
EndExtraDirs

BeginFilePairs
  raven-hmets.rvp.tpl;  raven-hmets.rvp
  raven-hmets.rvc.tpl;  raven-hmets.rvc
  #can be multiple (.rvh, .rvi)
EndFilePairs

#Parameter/DV Specification
BeginParams
  #parameter      init.    low      high    tx_in  tx_ost  tx_out
  par_x01         random   {lowerBounds.GAMMA_SHAPE}         {upperBounds.GAMMA_SHAPE}	       none   none     none
  par_x02         random   {lowerBounds.GAMMA_SCALE}	     {upperBounds.GAMMA_SCALE}	       none   none     none
  par_x03         random   {lowerBounds.GAMMA_SHAPE2}	     {upperBounds.GAMMA_SHAPE2}       none   none     none
  par_x04         random   {lowerBounds.GAMMA_SCALE2}	     {upperBounds.GAMMA_SCALE2}       none   none     none
  par_x05         random   {lowerBounds.MIN_MELT_FACTOR}     {upperBounds.MIN_MELT_FACTOR}    none   none     none
  par_x06         random   {lowerBounds.MAX_MELT_FACTOR}     {upperBounds.MAX_MELT_FACTOR}    none   none     none
  par_x07         random   {lowerBounds.DD_MELT_TEMP}	     {upperBounds.DD_MELT_TEMP}       none   none     none
  par_x08         random   {lowerBounds.DD_AGGRADATION}	     {upperBounds.DD_AGGRADATION}     none   none     none
  par_x09         random   {lowerBounds.SNOW_SWI_MIN}	     {upperBounds.SNOW_SWI_MIN}       none   none     none
  par_x10         random   {lowerBounds.SNOW_SWI_MAX}	     {upperBounds.SNOW_SWI_MAX}       none   none     none
  par_x11         random   {lowerBounds.SWI_REDUCT_COEFF}    {upperBounds.SWI_REDUCT_COEFF}   none   none     none
  par_x12         random   {lowerBounds.DD_REFREEZE_TEMP}    {upperBounds.DD_REFREEZE_TEMP}   none   none     none
  par_x13         random   {lowerBounds.REFREEZE_FACTOR}     {upperBounds.REFREEZE_FACTOR}    none   none     none
  par_x14         random   {lowerBounds.REFREEZE_EXP}	     {upperBounds.REFREEZE_EXP}       none   none     none
  par_x15         random   {lowerBounds.PET_CORRECTION}	     {upperBounds.PET_CORRECTION}     none   none     none
  par_x16         random   {lowerBounds.HMETS_RUNOFF_COEFF}  {upperBounds.HMETS_RUNOFF_COEFF} none   none     none
  par_x17         random   {lowerBounds.PERC_COEFF}	     {upperBounds.PERC_COEFF}	       none   none     none
  par_x18         random   {lowerBounds.BASEFLOW_COEFF_1}    {upperBounds.BASEFLOW_COEFF_1}   none   none     none
  par_x19         random   {lowerBounds.BASEFLOW_COEFF_2}    {upperBounds.BASEFLOW_COEFF_2}   none   none     none
  par_x20         random   {lowerBounds.TOPSOIL}	     {upperBounds.TOPSOIL}	       none   none     none
  par_x21         random   {lowerBounds.PHREATIC}            {upperBounds.PHREATIC}           none   none     none
EndParams

BeginTiedParams
  # par_sum_x05_x06 = par_x05 + par_x06
  # Xtied =(c3 * X1 * X2) + (c2 * X2) + (c1 * X1) + c0
  # --> c0 = 0.0
  # --> c1 = 1.0
  # --> c2 = 1.0
  # --> c3 = 0.0
  #
  par_sum_x05_x06 2 par_x05 par_x06 linear 0.00 1.00 1.00 0.00 free
  #
  # par_sum_x09_x10 = par_x09 + par_x10
  # Xtied =(c3 * X1 * X2) + (c2 * X2) + (c1 * X1) + c0
  # --> c0 = 0.0
  # --> c1 = 1.0
  # --> c2 = 1.0
  # --> c3 = 0.0
  #
  par_sum_x09_x10 2 par_x09 par_x10 linear 0.00 1.00 1.00 0.00 free
  #
  # par_half_x20 = par_x20 * 0.5 * 1000  --> half of it but in [mm] not [m]
  # Xtied = (c1 * X) + c0
  # --> c0 = 0.0
  # --> c1 = 500.
  #
  par_half_x20 1 par_x20 linear 500.0 0.0 free
  #
  # par_half_x21 = par_x21 * 0.5 * 1000  --> half of it but in [mm] not [m]
  # Xtied = (c1 * X) + c0
  # --> c0 = 0.0
  # --> c1 = 500.
  #
  par_half_x21 1 par_x21 linear 500.0 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
