28 REAL(
sp),
DIMENSION(:),
INTENT(IN) :: paraset
30 REAL(
sp),
DIMENSION(6,2) :: meas
31 REAL(
sp),
DIMENSION(6) :: calc
37 meas(:,1) = (/0.5_sp, 1.0_sp, 1.5_sp, 2.0_sp, 2.5_sp, 3.0_sp/)
38 meas(:,2) = (/5.7250_sp, 21.7000_sp, 49.1750_sp, 88.9000_sp, 141.6250_sp, 208.1000_sp/)
40 calc(:) = paraset(1)*meas(:,1)**3+paraset(2)*meas(:,1)**2+paraset(3)*meas(:,1)+paraset(4)
43 cost_sp = sum(abs( meas(:,2)-calc(:) ))/
size(meas,1)
53 REAL(
dp),
DIMENSION(:),
INTENT(IN) :: paraset
55 REAL(
dp),
DIMENSION(6,2) :: meas
56 REAL(
dp),
DIMENSION(6) :: calc
62 meas(:,1) = (/0.5_dp, 1.0_dp, 1.5_dp, 2.0_dp, 2.5_dp, 3.0_dp/)
63 meas(:,2) = (/5.7250_dp, 21.7000_dp, 49.1750_dp, 88.9000_dp, 141.6250_dp, 208.1000_dp/)
65 calc(:) = paraset(1)*meas(:,1)**3+paraset(2)*meas(:,1)**2+paraset(3)*meas(:,1)+paraset(4)
68 cost_dp = sum(abs( meas(:,2)-calc(:) ))/
size(meas,1)
78 REAL(
sp),
DIMENSION(:),
INTENT(IN) :: paraset
79 LOGICAL,
OPTIONAL,
INTENT(OUT) :: status_in
81 REAL(
sp),
DIMENSION(6,2) :: meas
82 REAL(
sp),
DIMENSION(6) :: calc
88 meas(:,1) = (/0.5_sp, 1.0_sp, 1.5_sp, 2.0_sp, 2.5_sp, 3.0_sp/)
89 meas(:,2) = (/5.7250_sp, 21.7000_sp, 49.1750_sp, 88.9000_sp, 141.6250_sp, 208.1000_sp/)
91 calc(:) = paraset(1)*meas(:,1)**3+paraset(2)*meas(:,1)**2+paraset(3)*meas(:,1)+paraset(4)
93 if (
present(status_in))
then
109 REAL(
dp),
DIMENSION(:),
INTENT(IN) :: paraset
110 LOGICAL,
OPTIONAL,
INTENT(OUT) :: status_in
112 REAL(
dp),
DIMENSION(6,2) :: meas
113 REAL(
dp),
DIMENSION(6) :: calc
119 meas(:,1) = (/0.5_dp, 1.0_dp, 1.5_dp, 2.0_dp, 2.5_dp, 3.0_dp/)
120 meas(:,2) = (/5.7250_dp, 21.7000_dp, 49.1750_dp, 88.9000_dp, 141.6250_dp, 208.1000_dp/)
122 calc(:) = paraset(1)*meas(:,1)**3+paraset(2)*meas(:,1)**2+paraset(3)*meas(:,1)+paraset(4)
124 if (
present(status_in))
then
138 REAL(
dp),
DIMENSION(:),
INTENT(IN) :: paraset
139 INTEGER(I4),
INTENT(IN) :: ipar
140 REAL(
dp),
DIMENSION(2),
INTENT(OUT) :: rangepar
164 rangepar(1) = 0.025_dp*paraset(2)
165 rangepar(2) = 10.0_dp
168 rangepar(2) = 40.0_dp*paraset(1)
171 rangepar(2) = 10.0_dp
182 REAL(
sp),
DIMENSION(:),
INTENT(IN) :: paraset
183 INTEGER(I4),
INTENT(IN) :: ipar
184 REAL(
sp),
DIMENSION(2),
INTENT(OUT) :: rangepar
208 rangepar(1) = 0.025_sp*paraset(2)
209 rangepar(2) = 10.0_sp
212 rangepar(2) = 40.0_sp*paraset(1)
215 rangepar(2) = 10.0_sp
232 real(
dp),
intent(in),
dimension(:) :: parameterset
234 real(
dp),
optional,
intent(in) :: arg1
235 real(
dp),
optional,
intent(out) :: arg2
236 real(
dp),
optional,
intent(out) :: arg3
239 type(
optidata_sim),
dimension(:),
allocatable :: et_opti
240 REAL(
dp),
DIMENSION(6,2) :: meas
241 REAL(
dp),
DIMENSION(6) :: calc
243 call eval(parameterset, etoptisim=et_opti)
249 meas(:,1) = (/0.5_dp, 1.0_dp, 1.5_dp, 2.0_dp, 2.5_dp, 3.0_dp/)
250 meas(:,2) = (/5.7250_dp, 21.7000_dp, 49.1750_dp, 88.9000_dp, 141.6250_dp, 208.1000_dp/)
252 calc(:) = parameterset(1)*meas(:,1)**3+parameterset(2)*meas(:,1)**2+parameterset(3)*meas(:,1)+parameterset(4)
Interface for evaluation routine.
Added for testing purposes of test_mo_anneal.
real(dp) function, public cost_objective(parameterset, eval, arg1, arg2, arg3)
dummy cost objective function
subroutine, public range_sp(paraset, ipar, rangepar)
dummy range
real(dp) function, public cost_dp(paraset)
function: f(x) = ax^3 + bx^2 + cx + d
subroutine, public range_dp(paraset, ipar, rangepar)
dummy range
real(sp) function, public cost_sp(paraset)
function: f(x) = ax^3 + bx^2 + cx + d
real(sp) function, public cost_valid_sp(paraset, status_in)
function: f(x) = ax^3 + bx^2 + cx + d
real(dp) function, public cost_valid_dp(paraset, status_in)
function: f(x) = ax^3 + bx^2 + cx + d
Define number representations.
integer, parameter sp
Single Precision Real Kind.
integer, parameter dp
Double Precision Real Kind.
Type definitions for optimization routines.
Utility functions, such as interface definitions, for optimization routines.
type for simulated optional data