Skip to contents

Generates a list of default calibration settings for a given hydromad model, including parameter bounds and optimizer configurations for DEoptim, malschains, and hydroPSO. Supports both SMA-only and SMA-routing model combinations.

Usage

set_hydromad_par(model, routing = "expuh")

Arguments

model

A string specifying the soil moisture accounting (SMA) model (e.g., "gr4j", "sacramento", "snow"), or a pre-defined hydromad model object. For a complete list see table in vignette("model_overview").

routing

A string specifying the routing model (e.g., "expuh", "lambda"). Only used if model is a string.

Value

A list containing:

  • lower, upper – numeric vectors of parameter bounds.

  • nof_param – number of parameters.

  • routing – the routing model used.

  • DEoptim, malschains, hydroPSO – optimizer settings.

  • has_snow_module – logical indicating whether the model includes a snow module.

Details

If a model string is provided, a temporary hydromad model is created using the specified SMA and routing. Parameter bounds are extracted using getFreeParsRanges. Routing parameters are only added for models that support routing.

Examples

set_hydromad_par("gr4j")
#> $routing
#> [1] "expuh"
#> 
#> $lower
#>    x1 tau_s tau_q   v_s 
#>   100     5     0     0 
#> 
#> $upper
#>    x1 tau_s tau_q   v_s 
#>  1200   100     5     1 
#> 
#> $nof_param
#> [1] 4
#> 
#> $DEoptim
#> $DEoptim$NP
#> [1] 40
#> 
#> $DEoptim$itermax
#> [1] 50
#> 
#> 
#> $malschains
#> $malschains$maxEvals
#> [1] 2000
#> 
#> 
#> $hydroPSO
#> $hydroPSO$control
#> $hydroPSO$control$write2disk
#> [1] FALSE
#> 
#> $hydroPSO$control$verbose
#> [1] FALSE
#> 
#> $hydroPSO$control$npart
#> [1] 80
#> 
#> $hydroPSO$control$maxit
#> [1] 50
#> 
#> $hydroPSO$control$reltol
#> [1] 1e-10
#> 
#> 
#> 
#> $has_snow_module
#> [1] FALSE
#> 
set_hydromad_par("sacramento")
#> $lower
#> uztwm uzfwm   uzk pctim adimp zperc  rexp lztwm lzfsm lzfpm  lzsk  lzpk pfree 
#> 1e+00 1e+00 1e-01 1e-06 0e+00 1e+00 0e+00 1e+00 1e+00 1e+00 1e-02 1e-04 0e+00 
#> 
#> $upper
#>   uztwm   uzfwm     uzk   pctim   adimp   zperc    rexp   lztwm   lzfsm   lzfpm 
#>  150.00  150.00    0.50    0.10    0.40  250.00    5.00  500.00 1000.00 1000.00 
#>    lzsk    lzpk   pfree 
#>    0.25    0.25    0.60 
#> 
#> $nof_param
#> [1] 13
#> 
#> $DEoptim
#> $DEoptim$NP
#> [1] 130
#> 
#> $DEoptim$itermax
#> [1] 200
#> 
#> 
#> $malschains
#> $malschains$maxEvals
#> [1] 2000
#> 
#> 
#> $hydroPSO
#> $hydroPSO$control
#> $hydroPSO$control$write2disk
#> [1] FALSE
#> 
#> $hydroPSO$control$verbose
#> [1] FALSE
#> 
#> $hydroPSO$control$npart
#> [1] 80
#> 
#> $hydroPSO$control$maxit
#> [1] 50
#> 
#> $hydroPSO$control$reltol
#> [1] 1e-10
#> 
#> 
#> 
#> $has_snow_module
#> [1] FALSE
#> 
set_hydromad_par(hydromad(DATA = NULL, sma = "snow", routing = "expuh"))
#> Error in hydromad(DATA = NULL, sma = "snow", routing = "expuh"): could not find function "hydromad"