From 798f511ab21cf001f0ec264c8c4863200f14cbf4 Mon Sep 17 00:00:00 2001 From: sbraccia Date: Mon, 27 Mar 2006 22:34:53 +0000 Subject: [PATCH] Fixed an error in the initialization of neb variables introduced recently. C.S git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2968 c92efa57-630b-4861-b058-cf58834340f0 --- Modules/path_base.f90 | 57 ++++++++++++++++++------------------ Modules/path_io_routines.f90 | 2 +- PW/compute_scf.f90 | 2 +- 3 files changed, 31 insertions(+), 30 deletions(-) diff --git a/Modules/path_base.f90 b/Modules/path_base.f90 index 50c6b9174..e37b14612 100644 --- a/Modules/path_base.f90 +++ b/Modules/path_base.f90 @@ -167,6 +167,34 @@ MODULE path_base ! END IF ! + ! ... initialization of the allocatable arrays + ! + pes = 0.D0 + grad_pes = 0.D0 + elastic_grad = 0.D0 + tangent = 0.D0 + grad = 0.D0 + error = 0.D0 + frozen = .FALSE. + ! + IF ( lneb ) THEN + ! + k = k_min + ! + climbing_ = climbing(1:num_of_images) + ! + ELSE IF ( lsmd ) THEN + ! + IF ( use_fourier ) THEN + ! + ! ... fourier components of the path + ! + ft_pos = 0.D0 + ! + END IF + ! + END IF + ! ! ... initial path is read from file ( restart_mode == "restart" ) or ! ... generated from the input images ( restart_mode = "from_scratch" ) ! ... It is always read from file in the case of "free-energy" @@ -216,34 +244,7 @@ MODULE path_base ! CALL initial_guess() ! - END IF - ! - ! ... initialization of the allocatable arrays - ! - posold = pos - pes = 0.D0 - grad_pes = 0.D0 - elastic_grad = 0.D0 - tangent = 0.D0 - grad = 0.D0 - error = 0.D0 - frozen = .FALSE. - ! - IF ( lneb ) THEN - ! - k = k_min - ! - climbing_ = climbing(1:num_of_images) - ! - ELSE IF ( lsmd ) THEN - ! - IF ( use_fourier ) THEN - ! - ! ... fourier components of the path - ! - ft_pos = 0.D0 - ! - END IF + posold(:,:) = pos(:,:) ! END IF ! diff --git a/Modules/path_io_routines.f90 b/Modules/path_io_routines.f90 index a0420fedd..b955f834c 100644 --- a/Modules/path_io_routines.f90 +++ b/Modules/path_io_routines.f90 @@ -219,7 +219,7 @@ MODULE path_io_routines if_pos(3,ia) ! grad_pes(:,1) = grad_pes(:,1) * & - DBLE( RESHAPE( if_pos, (/ dim /) ) ) + DBLE( RESHAPE( if_pos, (/ dim /) ) ) ! END DO ! diff --git a/PW/compute_scf.f90 b/PW/compute_scf.f90 index fb9f4f85c..69442e6ad 100644 --- a/PW/compute_scf.f90 +++ b/PW/compute_scf.f90 @@ -76,7 +76,7 @@ SUBROUTINE compute_scf( N_in, N_fin, stat ) ! IF ( my_image_id == root ) THEN ! - FORALL( image = N_in : N_fin, .NOT. frozen(image) ) + FORALL( image = N_in:N_fin, .NOT. frozen(image) ) ! pes(image) = 0.D0 grad_pes(:,image) = 0.D0