2005-05-17 03:19:04 +08:00
|
|
|
!
|
|
|
|
! Copyright (C) 2002-2005 FPMD-CPV groups
|
|
|
|
! This file is distributed under the terms of the
|
|
|
|
! GNU General Public License. See the file `License'
|
|
|
|
! in the root directory of the present distribution,
|
|
|
|
! or http://www.gnu.org/copyleft/gpl.txt .
|
|
|
|
!
|
2004-06-30 02:12:51 +08:00
|
|
|
!*********************************************************************
|
|
|
|
!
|
|
|
|
! subroutine SMLAMBDA for O-sesame/CP
|
|
|
|
!
|
2004-06-30 16:49:41 +08:00
|
|
|
! 042304 Y. Kanai
|
2004-06-30 02:12:51 +08:00
|
|
|
!
|
2004-06-30 16:49:41 +08:00
|
|
|
! iterative algorithme to calculate the lambda for the
|
|
|
|
! string method constraints.
|
2004-06-30 02:12:51 +08:00
|
|
|
!
|
2004-06-30 16:49:41 +08:00
|
|
|
! Version : As in the paper, but the initial guess for constant C
|
|
|
|
! is calculated from unparametrized string at t+dt.
|
2004-06-30 02:12:51 +08:00
|
|
|
!
|
|
|
|
!
|
|
|
|
!*********************************************************************
|
2005-07-15 14:52:02 +08:00
|
|
|
|
|
|
|
|
2004-06-30 02:12:51 +08:00
|
|
|
SUBROUTINE SMLAMBDA(statep,state,tan,con_ite,err_const)
|
|
|
|
|
2006-03-25 02:51:06 +08:00
|
|
|
use ions_base, ONLY: na, nsp, nat
|
|
|
|
use parameters, only: nsx
|
2004-11-02 00:43:29 +08:00
|
|
|
use path_variables, ONLY: &
|
|
|
|
sm_p => smd_p, &
|
|
|
|
ptr => smd_ptr, &
|
|
|
|
maxlm => smd_maxlm
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2005-07-15 14:52:02 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
IMPLICIT NONE
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-08-27 18:20:42 +08:00
|
|
|
integer :: i,j,is,ia,a,ite, isa
|
2004-06-30 16:49:41 +08:00
|
|
|
integer :: sm_k,smpm
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
integer :: n_const,exit_sign
|
|
|
|
integer, intent(out) :: con_ite
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2005-08-28 22:09:42 +08:00
|
|
|
real(8), intent(out) :: err_const(sm_p)
|
|
|
|
real(8) :: cons_c
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
type(ptr) :: statep(0:sm_p)
|
|
|
|
type(ptr) :: state(0:sm_p)
|
|
|
|
type(ptr) :: tan(0:sm_p)
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2006-03-25 02:51:06 +08:00
|
|
|
real(8) :: mov(3,nat,0:sm_p)
|
2005-08-28 22:09:42 +08:00
|
|
|
real(8) :: lambda(0:sm_p), dotp1, dotp2
|
|
|
|
real(8) :: dalpha(0:sm_p),t_alpha
|
|
|
|
real(8), ALLOCATABLE :: dotp1a(:), dotp2a(:), lam_f(:), lam_b(:)
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
!_______________________________________
|
|
|
|
!***************************************
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2005-07-15 14:52:02 +08:00
|
|
|
call start_clock( 'smlam')
|
|
|
|
ALLOCATE( dotp1a(0:sm_p))
|
|
|
|
ALLOCATE( dotp2a(0:sm_p))
|
|
|
|
ALLOCATE( lam_f(0:sm_p))
|
|
|
|
ALLOCATE( lam_b(0:sm_p))
|
2004-06-30 16:49:41 +08:00
|
|
|
smpm = sm_p -1
|
2004-06-30 02:12:51 +08:00
|
|
|
|
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
! ... Number of constraints ...
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
n_const = smpm
|
2004-06-30 02:12:51 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
! ... Initialization ...
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
exit_sign = 0
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
lambda(0:sm_p) = 0.d0
|
2005-07-15 14:52:02 +08:00
|
|
|
lam_f(0:sm_p) = 0.0d0
|
|
|
|
lam_b(0:sm_p) = 0.0d0
|
2004-06-30 02:12:51 +08:00
|
|
|
|
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
! ... Copy ...
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
DO sm_k=0,sm_p
|
2004-08-27 18:20:42 +08:00
|
|
|
isa = 0
|
2004-06-30 16:49:41 +08:00
|
|
|
DO is=1,nsp
|
|
|
|
DO ia=1,na(is)
|
2004-08-27 18:20:42 +08:00
|
|
|
isa = isa + 1
|
2004-06-30 02:12:51 +08:00
|
|
|
DO i=1,3
|
2004-08-27 18:20:42 +08:00
|
|
|
mov(i,isa,sm_k) = statep(sm_k)%d3(i,isa)
|
2004-06-30 16:49:41 +08:00
|
|
|
ENDDO
|
|
|
|
ENDDO
|
|
|
|
ENDDO
|
|
|
|
ENDDO
|
|
|
|
|
2004-06-30 02:12:51 +08:00
|
|
|
|
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
! ... Iteration loop ...
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
ite = 0
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
ITERATION_LOOP : DO ! >>>>>>>>>>>>>>>>>>>>>>>>>>>!
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
ite = ite+1
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
IF(ite > maxlm) THEN
|
|
|
|
ite = ite -1
|
|
|
|
GOTO 9090
|
|
|
|
ENDIF
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
exit_sign = 0
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
call CALC(mov,n_const,exit_sign,err_const,cons_c)
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
IF(exit_sign == 1) THEN
|
|
|
|
ite = ite-1
|
|
|
|
GOTO 9090
|
|
|
|
ENDIF
|
2005-07-15 14:52:02 +08:00
|
|
|
|
|
|
|
|
|
|
|
! ... calculate dalpha(i) = phi(i) - phi(i-1) ...
|
|
|
|
|
|
|
|
call ARC(statep,dalpha,t_alpha,1)
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2005-07-15 14:52:02 +08:00
|
|
|
! ... Calculate the const C ...
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2005-07-15 14:52:02 +08:00
|
|
|
call CALC(mov,n_const,exit_sign,err_const,cons_c)
|
2004-06-30 02:12:51 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2005-07-15 14:52:02 +08:00
|
|
|
CONSTRAINT_LOOP : DO a=0,n_const ! >>>>>>>>>>>>>>>>>>>>>>> !
|
2004-06-30 02:12:51 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
! ... tan(l)*dphi(l) ...
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
dotp1 = 0.d0
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-08-27 18:20:42 +08:00
|
|
|
isa = 0
|
2004-06-30 16:49:41 +08:00
|
|
|
DO is=1,nsp
|
|
|
|
DO ia=1,na(is)
|
2004-08-27 18:20:42 +08:00
|
|
|
isa = isa + 1
|
2004-06-30 16:49:41 +08:00
|
|
|
DO i=1,3
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
dotp1 = dotp1 &
|
2004-08-27 18:20:42 +08:00
|
|
|
& + (statep(a+1)%d3(i,isa)-statep(a)%d3(i,isa)) &
|
|
|
|
& * tan(a)%d3(i,isa)
|
2004-06-30 16:49:41 +08:00
|
|
|
|
|
|
|
ENDDO
|
|
|
|
ENDDO
|
|
|
|
ENDDO
|
2004-06-30 02:12:51 +08:00
|
|
|
|
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
! ... tan(l+1)*dphi(l) ...
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
dotp2 = 0.d0
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-08-27 18:20:42 +08:00
|
|
|
isa = 0
|
2004-06-30 16:49:41 +08:00
|
|
|
DO is=1,nsp
|
|
|
|
DO ia=1,na(is)
|
2004-08-27 18:20:42 +08:00
|
|
|
isa = isa + 1
|
2004-06-30 16:49:41 +08:00
|
|
|
DO i=1,3
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
dotp2 = dotp2 &
|
2004-08-27 18:20:42 +08:00
|
|
|
& + (statep(a+1)%d3(i,isa)-statep(a)%d3(i,isa)) &
|
|
|
|
& * tan(a+1)%d3(i,isa)
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
ENDDO
|
|
|
|
ENDDO
|
|
|
|
ENDDO
|
2004-06-30 02:12:51 +08:00
|
|
|
|
|
|
|
|
2005-07-15 14:52:02 +08:00
|
|
|
dotp1a(a) = dotp1
|
|
|
|
dotp2a(a) = dotp2
|
|
|
|
|
|
|
|
ENDDO CONSTRAINT_LOOP ! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<!
|
|
|
|
|
|
|
|
! do the forward loop, i.e. get a+1 from a
|
|
|
|
CONSTRAINT_LOOP2f : DO a=0,(n_const-1) ! >>>>>>>>>>>>>>>>>>>>>>> !
|
2004-06-30 16:49:41 +08:00
|
|
|
! ... Lagrange multiplier ...
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2005-07-15 14:52:02 +08:00
|
|
|
lam_f(a+1) = &
|
|
|
|
& ( cons_c - (t_alpha*dalpha(a+1))**2.d0 + 2.d0 *lam_f(a) * dotp1a(a)) &
|
|
|
|
& / (2.d0 *dotp2a(a))
|
|
|
|
! ... Update ...
|
|
|
|
ENDDO CONSTRAINT_LOOP2f ! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<!
|
|
|
|
|
|
|
|
! write(6,*) 'lam_f after the update ',lam_f
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2005-07-15 14:52:02 +08:00
|
|
|
! do the backward loop, i.e. get a from a+1
|
|
|
|
CONSTRAINT_LOOP2b : DO a=n_const,1,-1 ! >>>>>>>>>>>>>>>>>>>>>>> !
|
|
|
|
! ... Lagrange multiplier ...
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2005-07-15 14:52:02 +08:00
|
|
|
lam_b(a) = &
|
|
|
|
& -( cons_c - (t_alpha*dalpha(a+1))**2.d0 - 2.d0 *lam_b(a+1) * dotp2a(a)) &
|
|
|
|
& / (2.d0 *dotp1a(a))
|
2004-06-30 16:49:41 +08:00
|
|
|
! ... Update ...
|
2005-07-15 14:52:02 +08:00
|
|
|
ENDDO CONSTRAINT_LOOP2b ! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<!
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2005-07-15 14:52:02 +08:00
|
|
|
! write(6,*) 'lam_b after the update ',lam_b
|
|
|
|
|
|
|
|
lambda = 0.5d0*(lam_f+lam_b)
|
|
|
|
CONSTRAINT_LOOP3 : DO a=0,n_const-1 ! >>>>>>>>>>>>>>>>>>>>>>> !
|
|
|
|
isa = 0
|
2004-06-30 16:49:41 +08:00
|
|
|
DO is=1,nsp
|
|
|
|
DO ia=1,na(is)
|
2004-08-27 18:20:42 +08:00
|
|
|
isa = isa + 1
|
2004-06-30 16:49:41 +08:00
|
|
|
DO i=1,3
|
2004-08-27 18:20:42 +08:00
|
|
|
mov(i,isa,a+1) = statep(a+1)%d3(i,isa) + lambda(a+1)*tan(a+1)%d3(i,isa)
|
2004-06-30 16:49:41 +08:00
|
|
|
ENDDO
|
|
|
|
ENDDO
|
|
|
|
ENDDO
|
2005-07-15 14:52:02 +08:00
|
|
|
ENDDO CONSTRAINT_LOOP3 ! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<!
|
2004-06-30 02:12:51 +08:00
|
|
|
|
|
|
|
|
2005-07-15 14:52:02 +08:00
|
|
|
|
|
|
|
! write(6,*) 'lambda after the update ',lambda
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
ENDDO ITERATION_LOOP ! <<<<<<<<<<<<<<<<<<<<<<<< !
|
2004-06-30 02:12:51 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
! ... FINAL UPDATE ...
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
|
|
|
|
9090 IF(ite < maxlm) THEN
|
|
|
|
ELSE
|
|
|
|
call errore(' SUB. smlam ',': Maxlm exceeded. ',ite)
|
|
|
|
ENDIF
|
|
|
|
|
|
|
|
DO sm_k=1,smpm
|
2004-08-27 18:20:42 +08:00
|
|
|
isa = 0
|
2004-06-30 16:49:41 +08:00
|
|
|
DO is=1,nsp
|
|
|
|
DO ia=1,na(is)
|
2004-08-27 18:20:42 +08:00
|
|
|
isa = isa + 1
|
2004-06-30 16:49:41 +08:00
|
|
|
DO i=1,3
|
2004-08-27 18:20:42 +08:00
|
|
|
statep(sm_k)%d3(i,isa) = mov(i,isa,sm_k)
|
2004-06-30 16:49:41 +08:00
|
|
|
ENDDO
|
2004-06-30 02:12:51 +08:00
|
|
|
ENDDO
|
2004-06-30 16:49:41 +08:00
|
|
|
ENDDO
|
|
|
|
ENDDO
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
con_ite = ite
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2005-07-15 14:52:02 +08:00
|
|
|
DEALLOCATE( dotp1a,dotp2a,lam_f,lam_b)
|
|
|
|
call stop_clock( 'smlam')
|
2004-06-30 16:49:41 +08:00
|
|
|
RETURN
|
2004-06-30 02:12:51 +08:00
|
|
|
|
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
END SUBROUTINE SMLAMBDA
|
2004-06-30 02:12:51 +08:00
|
|
|
|
|
|
|
|
|
|
|
!======================================================================================
|
|
|
|
|
|
|
|
SUBROUTINE CALC(state,n_const,exit_sign,err_const,cons)
|
|
|
|
|
|
|
|
|
2006-03-25 02:51:06 +08:00
|
|
|
use ions_base, ONLY: na,nsp, nat
|
|
|
|
use parameters, only: nsx
|
2004-11-02 00:43:29 +08:00
|
|
|
use path_variables, ONLY: &
|
|
|
|
sm_p => smd_p, &
|
|
|
|
tol => smd_tol
|
2004-06-30 02:12:51 +08:00
|
|
|
|
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
IMPLICIT NONE
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-08-27 18:20:42 +08:00
|
|
|
integer :: i,is,ia,sm_k,sm_kk,smpm,ace, isa
|
2004-06-30 16:49:41 +08:00
|
|
|
integer, intent(out) :: exit_sign
|
|
|
|
integer, intent(in) :: n_const
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2005-08-28 22:09:42 +08:00
|
|
|
real(8), intent(out) :: err_const(sm_p)
|
|
|
|
real(8), intent(out) :: cons
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2006-03-25 02:51:06 +08:00
|
|
|
real(8) :: state(3,nat,0:sm_p),temp(3,nat)
|
2005-08-28 22:09:42 +08:00
|
|
|
real(8) :: dalpha(0:sm_p),t_alpha,alpha(0:sm_p)
|
|
|
|
real(8) :: diff, total
|
2004-06-30 02:12:51 +08:00
|
|
|
|
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
! ... ARC C ...
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
! -- seg.
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2005-07-15 14:52:02 +08:00
|
|
|
call start_clock( 'calc')
|
2004-06-30 16:49:41 +08:00
|
|
|
dalpha(0) = 0.d0
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
DO sm_k=1,sm_p
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
dalpha(sm_k) = 0.d0
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-08-27 18:20:42 +08:00
|
|
|
isa = 0
|
2004-06-30 16:49:41 +08:00
|
|
|
DO is=1,nsp
|
|
|
|
DO ia=1,na(is)
|
2004-08-27 18:20:42 +08:00
|
|
|
isa = isa + 1
|
2004-06-30 02:12:51 +08:00
|
|
|
DO i=1,3
|
2004-08-27 18:20:42 +08:00
|
|
|
temp(i,isa) = state(i,isa,sm_k) - state(i,isa,sm_k-1)
|
2004-06-30 16:49:41 +08:00
|
|
|
ENDDO
|
|
|
|
ENDDO
|
|
|
|
ENDDO
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-08-27 18:20:42 +08:00
|
|
|
isa = 0
|
2004-06-30 16:49:41 +08:00
|
|
|
DO is=1,nsp
|
|
|
|
DO ia=1,na(is)
|
2004-08-27 18:20:42 +08:00
|
|
|
isa = isa + 1
|
2004-06-30 02:12:51 +08:00
|
|
|
DO i=1,3
|
2004-08-27 18:20:42 +08:00
|
|
|
dalpha(sm_k) = dalpha(sm_k) + temp(i,isa)*temp(i,isa)
|
2004-06-30 16:49:41 +08:00
|
|
|
ENDDO
|
2004-06-30 02:12:51 +08:00
|
|
|
ENDDO
|
2004-06-30 16:49:41 +08:00
|
|
|
ENDDO
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
dalpha(sm_k) = DSQRT(dalpha(sm_k))
|
|
|
|
ENDDO
|
2004-06-30 02:12:51 +08:00
|
|
|
|
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
! -- total.
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
t_alpha = 0.d0
|
|
|
|
alpha = 0.d0
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
DO sm_k=0,sm_p
|
|
|
|
DO sm_kk=0,sm_k
|
|
|
|
alpha(sm_k) = alpha(sm_k) + dalpha(sm_kk)
|
|
|
|
ENDDO
|
|
|
|
ENDDO
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
t_alpha = alpha(sm_p)
|
|
|
|
|
|
|
|
|
|
|
|
! -- Norm.
|
|
|
|
|
|
|
|
DO sm_k=1,sm_p
|
|
|
|
alpha(sm_k) = alpha(sm_k)/t_alpha
|
|
|
|
dalpha(sm_k) = dalpha(sm_k)/t_alpha
|
|
|
|
ENDDO
|
2004-06-30 02:12:51 +08:00
|
|
|
|
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
! ** Check if the constraint is ok
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
ace = 0
|
|
|
|
exit_sign = 0
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
DO sm_k=1,sm_p
|
2005-08-28 22:09:42 +08:00
|
|
|
diff = DABS(dalpha(sm_k) - 1.d0/DBLE(sm_p))
|
2004-06-30 16:49:41 +08:00
|
|
|
err_const(sm_k) = diff
|
|
|
|
IF(diff <= tol) ace = ace+1
|
|
|
|
ENDDO
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
IF(ace == sm_p) THEN
|
|
|
|
exit_sign = 1
|
2005-07-15 14:52:02 +08:00
|
|
|
call stop_clock( 'calc')
|
2004-06-30 16:49:41 +08:00
|
|
|
RETURN
|
|
|
|
ENDIF
|
2004-06-30 02:12:51 +08:00
|
|
|
|
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
! ... Calc const.C
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
total = 0.d0
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
DO sm_k = 1,sm_p
|
|
|
|
total = total + (dalpha(sm_k)*t_alpha)**2.d0
|
|
|
|
ENDDO
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2005-08-28 22:09:42 +08:00
|
|
|
cons = total/DBLE(sm_p)
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2005-07-15 14:52:02 +08:00
|
|
|
call stop_clock( 'calc')
|
2004-06-30 16:49:41 +08:00
|
|
|
RETURN
|
2004-06-30 02:12:51 +08:00
|
|
|
|
2004-06-30 16:49:41 +08:00
|
|
|
END SUBROUTINE CALC
|
2004-06-30 02:12:51 +08:00
|
|
|
|
|
|
|
|
|
|
|
|