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