0.6.2-dev0
FORCES
FORtran lib for Comp. Env. Sys.
Loading...
Searching...
No Matches
mo_dds Module Reference

Dynamically Dimensioned Search (DDS) More...

Functions/Subroutines

real(dp) function, dimension(size(pini)), public dds (eval, obj_func, pini, prange, r, seed, maxiter, maxit, mask, tmp_file, funcbest, history)
 DDS.
 
real(dp) function, dimension(size(pini)), public mdds (eval, obj_func, pini, prange, seed, maxiter, maxit, mask, tmp_file, funcbest, history)
 MDDS.
 
subroutine neigh_value (x_cur, x_min, x_max, r, new_value)
 

Detailed Description

Dynamically Dimensioned Search (DDS)

This module provides routines for Dynamically Dimensioned Search (DDS) of Tolson and Shoemaker (2007). It searches the minimum or maximum of a user-specified function, using an n-dimensional continuous global optimization algorithm (DDS).

Authors
Bryan Tolson, modified by Rohini Kumar, Matthias Cuntz and Juliane Mai.
Date
Jul 2012

Function/Subroutine Documentation

◆ dds()

real(dp) function, dimension(size(pini)), public mo_dds::dds ( procedure(eval_interface), intent(in), pointer  eval,
procedure(objective_interface), intent(in), pointer  obj_func,
real(dp), dimension(:), intent(in)  pini,
real(dp), dimension(:, :), intent(in)  prange,
real(dp), intent(in), optional  r,
integer(i8), intent(in), optional  seed,
integer(i8), intent(in), optional  maxiter,
logical, intent(in), optional  maxit,
logical, dimension(:), intent(in), optional  mask,
character(len = *), intent(in), optional  tmp_file,
real(dp), intent(out), optional  funcbest,
real(dp), dimension(:), intent(out), optional, allocatable  history 
)

DDS.

Searches Minimum or Maximum of a user-specified function using Dynamically Dimensioned Search (DDS).
DDS is an n-dimensional continuous global optimization algorithm. It is coded as a minimizer but one can give maxit=True in a maximization problem, so that the algorithm minimizes the negative of the objective function F=(-1*F).

The function to be minimized is the first argument of DDS and must be defined as

function func(p)
use mo_kind, only: dp
implicit none
real(dp), dimension(:), intent(in) :: p
real(dp) :: func
end function func
Define number representations.
Definition mo_kind.F90:17
integer, parameter dp
Double Precision Real Kind.
Definition mo_kind.F90:46

Example

dv_range(:,1) = (/ -600.0, -600.0, -600.0, -600.0, -600.0, -600.0, -600.0, -600.0, -600.0, -600.0 /)
dv_range(:,2) = (/ 600.0, 600.0, 600.0, 600.0, 600.0, 600.0, 600.0, 600.0, 600.0, 600.0 /)
dv_ini = (/ -.226265e+01, -.130187e+01, -.151219e+01, 0.133983e+00, 0.988159e+00, &
-.495074e+01, -.126574e+02, 0.572684e+00, 0.303864e+01, 0.343031e+01 /)
dv_opt = dds(griewank, dv_ini, dv_range)

See also example in test directory.

Literature

  1. Tolson, B. A., and C. A. Shoemaker (2007) Dynamically dimensioned search algorithm for computationally efficient watershed model calibration, Water Resour. Res., 43, W01413, doi:10.1029/2005WR004723.
Parameters
[in]real(dp) :: obj_func(p)Function on which to search the minimum
[in]real(dp) :: pini(:)inital value of decision variables
[in]real(dp) :: prange(size(pini),2)Min/max range of decision variables
[in]real(dp), optional :: rDDS perturbation parameter
(default: 0.2)
[in]integer(i8), optional :: seedUser seed to initialise the random number generator (default: None)
[in]integer(i8), optional :: maxiterMaximum number of iteration or function evaluation (default: 1000)
[in]logical, optional :: maxitMaximization (.True.) or minimization (.False.) of function (default: .False.)
[in]logical, optional :: mask(size(pini))parameter to be optimized (true or false) (default: .True.)
[in]character(len=*) , optional :: tmp_filefile with temporal output
[out]real(dp), optional :: funcbestthe best value of the function.
[out]real(dp), optional, allocatable :: history(:)the history of best function values, history(maxiter)=funcbest
allocatable only to be in correspondance with other optimization routines
Return values
real(dp) :: DDSThe parameters of the point which is estimated to minimize the function.
Author
Bryan Tolson
Date
Feb 2007
Author
Rohini Kumar
Date
Feb 2008
Author
Matthias Cuntz & Juliane Mai
Date
Jul 2012
  • module
Author
Juliane Mai
Date
Aug 2012
  • optional argument funcbest added
Nov 2012
  • masked parameter
Dec 2012
  • history output
Author
Pallav Kumar Shrestha
Date
Jun 2019
  • Added "dds_results.out.current" output file with current iteration (non-updated) parameters

Definition at line 109 of file mo_dds.F90.

References dds(), mo_kind::dp, mo_kind::i4, and mo_kind::i8.

Referenced by dds().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mdds()

real(dp) function, dimension(size(pini)), public mo_dds::mdds ( procedure(eval_interface), intent(in), pointer  eval,
procedure(objective_interface), intent(in), pointer  obj_func,
real(dp), dimension(:), intent(in)  pini,
real(dp), dimension(:, :), intent(in)  prange,
integer(i8), intent(in), optional  seed,
integer(i8), intent(in), optional  maxiter,
logical, intent(in), optional  maxit,
logical, dimension(:), intent(in), optional  mask,
character(len = *), intent(in), optional  tmp_file,
real(dp), intent(out), optional  funcbest,
real(dp), dimension(:), intent(out), optional, allocatable  history 
)

MDDS.

Searches Minimum or Maximum of a user-specified function using the Modified Dynamically Dimensioned Search (DDS).
DDS is an n-dimensional continuous global optimization algorithm. It is coded as a minimizer but one can give maxit=True in a maximization problem, so that the algorithm minimizes the negative of the objective function F=(-1*F).
The function to be minimized is the first argument of DDS and must be defined as

function func(p)
use mo_kind, only: dp
implicit none
real(dp), dimension(:), intent(in) :: p
real(dp) :: func
end function func

MDDS extents normal DDS by a continuous reduction of the DDS pertubation parameter r from 0.3 to 0.05, and by allowing a larger function value with a certain probablity.

Parameters
[in]real(dp) :: obj_func(p)Function on which to search the minimum
[in]real(dp) :: pini(:)inital value of decision variables
[in]real(dp) :: prange(size(pini),2)Min/max range of decision variables
[in]integer(i8), optional :: seedUser seed to initialise the random number generator (default: None)
[in]integer(i8), optional :: maxiterMaximum number of iteration or function evaluation (default: 1000)
[in]logical, optional :: maxitMaximization (.True.) or minimization (.False.) of function (default: .False.)
[in]logical, optional :: mask(size(pini))parameter to be optimized (true or false) (default: .True.)
[in]character(len=*) , optional :: tmp_filefile with temporal output
[out]real(dp), optional :: funcbestthe best value of the function.
[out]real(dp), optional, allocatable :: history(:)the history of best function values, history(maxiter)=funcbest
allocatable only to be in correspondance with other optimization routines
Returns
real(dp) :: MDDS — The parameters of the point which is estimated to minimize the function.

Restrictions

None.

Example

dv_range(:,1) = (/ -600.0, -600.0, -600.0, -600.0, -600.0, -600.0, -600.0, -600.0, -600.0, -600.0 /)
dv_range(:,2) = (/ 600.0, 600.0, 600.0, 600.0, 600.0, 600.0, 600.0, 600.0, 600.0, 600.0 /)
dv_ini        = (/ -.226265E+01, -.130187E+01, -.151219E+01, 0.133983E+00, 0.988159E+00, &
                   -.495074E+01, -.126574E+02, 0.572684E+00, 0.303864E+01, 0.343031E+01 /)
dv_opt = MDDS(griewank, dv_ini, dv_range)

See also example in test directory.

Literature

  1. Tolson, B. A., and C. A. Shoemaker (2007), Dynamically dimensioned search algorithm for computationally efficient watershed model calibration, Water Resour. Res., 43, W01413, doi:10.1029/2005WR004723.
  2. Huang X-L and Xiong J (2010), Parameter Optimization of Multi-tank Model with Modified Dynamically Dimensioned Search Algorithm, Proceedings of the Third International Symposium on Computer Science and Computational Technology(ISCSCT ''10), Jiaozuo, P. R. China, 14-15 August 2010, pp. 283-288
    Author
    Written Matthias Cuntz and Juliane Mai
    Date
    Aug 2012

Definition at line 422 of file mo_dds.F90.

References mo_kind::dp, mo_kind::i4, mo_kind::i8, and mdds().

Referenced by mdds().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ neigh_value()

subroutine mo_dds::neigh_value ( real(dp), intent(in)  x_cur,
real(dp), intent(in)  x_min,
real(dp), intent(in)  x_max,
real(dp), intent(in)  r,
real(dp), intent(out)  new_value 
)
private

Definition at line 638 of file mo_dds.F90.