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