From cc7fa8cf760a142ca332816d582f371f586eeb00 Mon Sep 17 00:00:00 2001 From: akasharora123 Date: Tue, 19 Apr 2016 10:18:35 -0500 Subject: [PATCH] Adding replacement for norm2 to iterate_mod --- src/iterate/iterate_mod.fp.f | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/iterate/iterate_mod.fp.f b/src/iterate/iterate_mod.fp.f index df514d7..ce5115e 100644 --- a/src/iterate/iterate_mod.fp.f +++ b/src/iterate/iterate_mod.fp.f @@ -1357,13 +1357,6 @@ subroutine iterate_AM( & endif write(6,*)'Stress relaxation iteration = ',itr_stress -!! itr_relax = 0 -!! stress_relax: do - -!! if(maxval(abs(stress)*stress_rescale) < error_max) exit stress_relax - -!! itr_relax = itr_relax + 1 -!! write(6,*)'Stress relaxation for fixed omega = ',itr_relax call response_dstress_dcell(N,omega,dstress_dcell ) @@ -1502,6 +1495,21 @@ subroutine iterate_AM( & ! If fixed unit cell, calculate residual stress before output if (.not.domain) stress = scf_stress(N, N_cell_param, dGsq) +contains + + function norm2(x) + + implicit none + + intrinsic :: dot_product, sqrt + real(long) :: norm2 + real(long), intent(IN) :: x(:) + + norm2 = sqrt(dot_product(x,x)) + + end function norm2 + + end subroutine iterate_AM end module iterate_mod