functionfoo(p)double precision foo
double precisionp(2)
foo=p(1)**2+p(2)**2;returnend function foo
program main
double precision foo
double precisionp(2)integer np
double precision precision
np=2precision=1e-10p(1)=4000p(2)=5000write(*,*) p,foo(p)calloptimize_powell(foo,np,p,precision)write(*,*) p,foo(p)end program main