3 integer,
parameter :: rk = kind(1.0d0)
4 integer,
intent(in) :: n
5 real(kind=rk),
dimension(n),
intent(in) :: x
6 real(kind=rk),
intent(out) :: f
8 real(kind=rk),
dimension(2) :: fullx
9 integer :: mpi_rank,mpi_err
11 integer :: status(mpi_status_size)
14 call mpi_comm_rank(mpi_comm_world,mpi_rank,mpi_err)
19 call mpi_send(fullx(1),1,mpi_double_precision,1,1,mpi_comm_world&
21 call mpi_recv(fullx(2),1,mpi_double_precision,1,1,mpi_comm_world&
25 call mpi_recv(fullx(1),1,mpi_double_precision,0,1,mpi_comm_world&
27 call mpi_send(fullx(2),1,mpi_double_precision,0,1,mpi_comm_world&
30 print*,
'too many processes launched for the model. Error'
35 f = 100.*((fullx(2) - fullx(1)**2)**2) + (1. - fullx(1))**2
subroutine objective_function(n, x, f)