File: ggamt_2a.f90

package info (click to toggle)
elkcode 5.4.24-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 12,840 kB
  • sloc: f90: 48,415; fortran: 22,457; perl: 965; makefile: 384; sh: 369; python: 105; ansic: 67
file content (46 lines) | stat: -rw-r--r-- 1,163 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

! Copyright (C) 2009 T. McQueen and J. K. Dewhurst.
! This file is distributed under the terms of the GNU General Public License.
! See the file COPYING for license details.

!BOP
! !ROUTINE: ggamt_2a
! !INTERFACE:
subroutine ggamt_2a(ias,g2rho,gvrho,grho2)
! !USES:
use modmain
! !DESCRIPTION:
!   Spin-unpolarised version of {\tt ggamt\_sp\_2a}.
!
! !REVISION HISTORY:
!   Created November 2009 (JKD and TMcQ)
!EOP
!BOC
implicit none
! arguments
integer, intent(in) :: ias
real(8), intent(out) :: g2rho(npmtmax),gvrho(npmtmax,3),grho2(npmtmax)
! local variables
integer is,nr,nri,np,i
! allocatable arrays
real(8), allocatable :: rfmt(:),grfmt(:,:)
allocate(rfmt(npmtmax),grfmt(npmtmax,3))
is=idxis(ias)
nr=nrmt(is)
nri=nrmti(is)
np=npmt(is)
! compute grad^2 rho in spherical coordinates
call grad2rfmt(nr,nri,rsp(:,is),rhomt(:,ias),rfmt)
call rbsht(nr,nri,rfmt,g2rho)
! compute grad rho in spherical coordinates
call gradrfmt(nr,nri,rsp(:,is),rhomt(:,ias),npmtmax,grfmt)
do i=1,3
  call rbsht(nr,nri,grfmt(:,i),gvrho(:,i))
end do
! (grad rho)^2
grho2(1:np)=gvrho(1:np,1)**2+gvrho(1:np,2)**2+gvrho(1:np,3)**2
deallocate(rfmt,grfmt)
return
end subroutine
!EOC