7 integer, save :: icheck
= 0
16 function cost(p
) result(y
)
17 double precision,dimension(:) :: p
18 double precision,dimension(:),allocatable
:: y
22 if (any (cost([1d0,2d0]) /= [2.d0
, 4.d0
])) STOP 1
29 procedure(cost1
),pointer :: pcost
35 function cost1(x
) result(y
)
36 double precision,dimension(:) :: x
37 double precision,dimension(:),allocatable
:: y
44 function cost(x
) result(y
)
45 double precision,dimension(:) :: x
46 double precision,dimension(:),allocatable
:: y
59 if (any (cost([3.d0
,7.d0
]) /= [6.d0
, 14.d0
])) STOP 2
60 if (icheck
/= 0) STOP 3
62 if (icheck
/= 1) STOP 4