EMPIRE DA  v1.9.1
Data assimilation codes using EMPIRE communication
 All Classes Files Functions Variables Pages
call.f90
Go to the documentation of this file.
1 program call
2 implicit none
3 integer :: i
4 
5 integer :: n !size of optimization state vector
6 integer :: method ! the type of nonlinear cg
7 
8 real(kind=kind(1.0d0)), allocatable, dimension(:) :: x0
9 real(kind=kind(1.0d0)) :: epsin=0.1d0
10 
11 include 'mpif.h'
12 integer :: mpi_err,mpi_size
13 
14 
15 call mpi_init(mpi_err)
16 call mpi_comm_size(mpi_comm_world,mpi_size,mpi_err)
17 
18 
19 n = 1 !rosenbrock test function, one variable per process
20 
21 
22 
23 
24 !method = 1 ! FLETCHER-REEVES
25 method = 2 ! POLAK-RIBIERE
26 !method = 3 ! POSITIVE POLAK-RIBIERE ( BETA=MAX{BETA,0} )
27 
28 allocate(x0(n))
29 do i=1,n
30  x0(i) = -2.d+00
31 end do
32 
33 
34 
35 
36 call subroutine_cg(method,n,epsin,x0,mpi_comm_world,mpi_size)
37 
38 
39 deallocate(x0)
40 
41 call mpi_finalize(mpi_err)
42 
43 end program call
subroutine subroutine_cg(method, n, epsin, x)
Nonlinear Conjugate gradient method as callable subroutine.
Definition: cgsub.f90:27
program call
Definition: call.f90:1