dkomati1 at geodynamics.org dkomati1 at geodynamics.org
Wed Jul 31 07:59:48 PDT 2013

```Author: dkomati1
Date: 2013-07-31 07:59:48 -0700 (Wed, 31 Jul 2013)
New Revision: 22689

Modified:
Log:
added a comment about the book of Nocedal.
Also removed all useless MPI_Barriers.

===================================================================
--- seismo/3D/ADJOINT_TOMO/ADJOINT_TOMOGRAPHY_TOOLKIT/ITERATION_UPDATE/X04_SRC_DIRECTION_LBFGS/compute_direction_lbfgs.f90	2013-07-30 20:07:39 UTC (rev 22688)
+++ seismo/3D/ADJOINT_TOMO/ADJOINT_TOMOGRAPHY_TOOLKIT/ITERATION_UPDATE/X04_SRC_DIRECTION_LBFGS/compute_direction_lbfgs.f90	2013-07-31 14:59:48 UTC (rev 22689)
@@ -92,12 +92,10 @@
model_diff=model1-model0

-     call mpi_barrier(MPI_COMM_WORLD,ier)
call mpi_allreduce(p_tmp,p_sum,1,CUSTOM_MPI_TYPE,MPI_SUM,MPI_COMM_WORLD,ier)
p(istore)=1.0/p_sum

a_tmp=sum(model_diff*q_vector)
-     call mpi_barrier(MPI_COMM_WORLD,ier)
call mpi_allreduce(a_tmp,a_sum,1,CUSTOM_MPI_TYPE,MPI_SUM,MPI_COMM_WORLD,ier)
a(istore)=p(istore)*a_sum

@@ -105,7 +103,6 @@
end do

-  !
istore=iter_current-1
@@ -113,11 +110,11 @@
call get_model(istore,model0)
model_diff=model1-model0
-  !

+! this implements Algorithm 7.4 and equation (7.20) on page 178 of the book of
+! Jorge Nocedal and Stephen Wright, "Numerical Optimization", Springer, second edition (2006)
-  call mpi_barrier(MPI_COMM_WORLD,ier)
call mpi_allreduce(p_k_up,p_k_up_sum,1,CUSTOM_MPI_TYPE,MPI_SUM,MPI_COMM_WORLD,ier)
call mpi_allreduce(p_k_down,p_k_down_sum,1,CUSTOM_MPI_TYPE,MPI_SUM,MPI_COMM_WORLD,ier)
p_k=p_k_up_sum/p_k_down_sum
@@ -142,7 +139,6 @@
model_diff=model1-model0