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 integer, allocatable, dimension(:) :: nbd
10 real(kind=kind(1.0d0)), allocatable, dimension(:) :: l
11 real(kind=kind(1.0d0)), allocatable, dimension(:) :: u
12 
13 n = 25 ! test function
14 
15 
16 
17 
18 !method = 1 ! FLETCHER-REEVES
19 method = 2 ! POLAK-RIBIERE
20 !method = 3 ! POSITIVE POLAK-RIBIERE ( BETA=MAX{BETA,0} )
21 
22 allocate(x0(n))
23 do i=1,n
24  x0(i) = 3.0d0
25 end do
26 
27 
28 
29 
30 call lbfgs_sub(n,x0)
31 print*,'result of lbfgs = ',x0
32 
33 
34 allocate(nbd(n),l(n),u(n))
35 
36 do i=1,n
37  x0(i) = 3.0d0
38 end do
39 
40 
41 nbd = 0
42 do 10 i=1, n, 2
43  nbd(i) = 2
44  l(i) = 1.0d0
45  u(i) = 1.0d2
46 10 continue
47 
48 ! Next set bounds on the even-numbered variables.
49 
50 do 12 i=2, n, 2
51  nbd(i) = 2
52  l(i) = -1.0d2
53  u(i) = 1.0d2
54 12 continue
55 
56 call lbfgsb_sub(n,x0,nbd,l,u)
57 print*,'result of lbfgsb = ',x0
58 
59 deallocate(x0)
60 end program call
subroutine lbfgsb_sub(n, factr_in, pgtol_in, x, nbd, l, u)
Limited memory BFGS bound constrained optimization code as callable subroutine.
Definition: lbfgsb_sub.f90:210
subroutine lbfgs_sub(n, factr_in, pgtol_in, x)
Limited memory BFGS unconstrained optimization code as callable subroutine.
Definition: lbfgs_sub.f90:198
program call
Definition: call.f90:1