1 |
gezelter |
264 |
!! Interfaces for C programs to module.... |
2 |
|
|
|
3 |
chrisfen |
608 |
subroutine initFortranFF(correctionMethod, dampingAlpha, thisStat) |
4 |
gezelter |
264 |
use doForces, ONLY: init_FF |
5 |
chrisfen |
596 |
use definitions, ONLY : dp |
6 |
|
|
|
7 |
|
|
integer, intent(in) :: correctionMethod |
8 |
|
|
real(kind=dp), intent(in) :: dampingAlpha |
9 |
gezelter |
581 |
integer, intent(out) :: thisStat |
10 |
chrisfen |
596 |
logical :: use_RF |
11 |
|
|
integer :: correction |
12 |
|
|
real(kind=dp) :: alpha |
13 |
gezelter |
581 |
|
14 |
chrisfen |
596 |
correction = correctionMethod |
15 |
|
|
alpha = dampingAlpha |
16 |
|
|
|
17 |
chrisfen |
608 |
call init_FF(correction, alpha, thisStat) |
18 |
gezelter |
507 |
|
19 |
gezelter |
264 |
end subroutine initFortranFF |
20 |
|
|
|
21 |
|
|
subroutine doForceloop(q, q_group, A, eFrame, f, t, tau, pot, & |
22 |
|
|
do_pot_c, do_stress_c, error) |
23 |
gezelter |
507 |
|
24 |
gezelter |
264 |
use definitions, ONLY: dp |
25 |
|
|
use simulation |
26 |
|
|
use doForces, ONLY: do_force_loop |
27 |
|
|
!! Position array provided by C, dimensioned by getNlocal |
28 |
|
|
real ( kind = dp ), dimension(3, nLocal) :: q |
29 |
|
|
!! molecular center-of-mass position array |
30 |
|
|
real ( kind = dp ), dimension(3, nGroups) :: q_group |
31 |
|
|
!! Rotation Matrix for each long range particle in simulation. |
32 |
|
|
real( kind = dp), dimension(9, nLocal) :: A |
33 |
|
|
!! Unit vectors for dipoles (lab frame) |
34 |
|
|
real( kind = dp ), dimension(9,nLocal) :: eFrame |
35 |
|
|
!! Force array provided by C, dimensioned by getNlocal |
36 |
|
|
real ( kind = dp ), dimension(3,nLocal) :: f |
37 |
|
|
!! Torsion array provided by C, dimensioned by getNlocal |
38 |
|
|
real( kind = dp ), dimension(3,nLocal) :: t |
39 |
gezelter |
507 |
|
40 |
gezelter |
264 |
!! Stress Tensor |
41 |
|
|
real( kind = dp), dimension(9) :: tau |
42 |
|
|
real ( kind = dp ) :: pot |
43 |
|
|
logical ( kind = 2) :: do_pot_c, do_stress_c |
44 |
|
|
integer :: error |
45 |
gezelter |
507 |
|
46 |
gezelter |
264 |
call do_force_loop(q, q_group, A, eFrame, f, t, tau, pot, & |
47 |
|
|
do_pot_c, do_stress_c, error) |
48 |
gezelter |
507 |
|
49 |
gezelter |
264 |
end subroutine doForceloop |
50 |
gezelter |
586 |
|