| 1 |
chuckv |
4 |
module second_deriv |
| 2 |
|
|
use definitions, only: dp |
| 3 |
|
|
use status, only: error,info,warning |
| 4 |
|
|
implicit none |
| 5 |
|
|
|
| 6 |
|
|
public :: alloc_sec_deriv, dealloc_sec_deriv |
| 7 |
|
|
|
| 8 |
|
|
real(dp),public,allocatable, dimension(:,:) :: d |
| 9 |
|
|
real(dp),public,allocatable, dimension(:) :: evals |
| 10 |
|
|
|
| 11 |
|
|
contains |
| 12 |
|
|
|
| 13 |
|
|
subroutine alloc_sec_deriv(ndim,natoms) |
| 14 |
|
|
integer, intent(in) :: ndim,natoms |
| 15 |
|
|
integer ierror |
| 16 |
|
|
|
| 17 |
|
|
|
| 18 |
|
|
allocate(d(natoms*ndim,natoms*ndim),STAT=ierror) |
| 19 |
|
|
if (ierror /= 0) then |
| 20 |
|
|
call error( 'MALLOC_2DERIV', 'Error in allocating memory') |
| 21 |
|
|
end if |
| 22 |
|
|
d = 0.0_DP |
| 23 |
|
|
|
| 24 |
|
|
end subroutine alloc_sec_deriv |
| 25 |
|
|
|
| 26 |
|
|
subroutine dealloc_sec_deriv() |
| 27 |
|
|
deallocate(d) |
| 28 |
|
|
end subroutine dealloc_sec_deriv |
| 29 |
|
|
|
| 30 |
|
|
subroutine alloc_evals(ndim,natoms) |
| 31 |
|
|
integer, intent(in) :: ndim,natoms |
| 32 |
|
|
integer ierror |
| 33 |
|
|
|
| 34 |
|
|
|
| 35 |
|
|
allocate(evals(natoms*ndim),STAT=ierror) |
| 36 |
|
|
if (ierror /= 0) then |
| 37 |
|
|
call error( 'MALLOC_2DERIV', 'Error in allocating memory') |
| 38 |
|
|
end if |
| 39 |
|
|
evals = 0.0d0 |
| 40 |
|
|
|
| 41 |
|
|
end subroutine alloc_evals |
| 42 |
|
|
|
| 43 |
|
|
subroutine dealloc_evals() |
| 44 |
|
|
deallocate(evals) |
| 45 |
|
|
end subroutine dealloc_evals |
| 46 |
|
|
|
| 47 |
|
|
end module second_deriv |