| 1 |
gezelter |
264 |
!! Interfaces for C programs to module.... |
| 2 |
|
|
|
| 3 |
gezelter |
762 |
subroutine initFortranFF(thisStat) |
| 4 |
gezelter |
264 |
use doForces, ONLY: init_FF |
| 5 |
chrisfen |
596 |
use definitions, ONLY : dp |
| 6 |
|
|
|
| 7 |
gezelter |
581 |
integer, intent(out) :: thisStat |
| 8 |
|
|
|
| 9 |
gezelter |
762 |
call init_FF(thisStat) |
| 10 |
gezelter |
507 |
|
| 11 |
gezelter |
264 |
end subroutine initFortranFF |
| 12 |
|
|
|
| 13 |
|
|
subroutine doForceloop(q, q_group, A, eFrame, f, t, tau, pot, & |
| 14 |
|
|
do_pot_c, do_stress_c, error) |
| 15 |
gezelter |
507 |
|
| 16 |
gezelter |
264 |
use definitions, ONLY: dp |
| 17 |
|
|
use simulation |
| 18 |
|
|
use doForces, ONLY: do_force_loop |
| 19 |
chuckv |
659 |
|
| 20 |
|
|
#define __FORTRAN90 |
| 21 |
|
|
#include "UseTheForce/DarkSide/fInteractionMap.h" |
| 22 |
|
|
|
| 23 |
gezelter |
264 |
!! Position array provided by C, dimensioned by getNlocal |
| 24 |
|
|
real ( kind = dp ), dimension(3, nLocal) :: q |
| 25 |
|
|
!! molecular center-of-mass position array |
| 26 |
|
|
real ( kind = dp ), dimension(3, nGroups) :: q_group |
| 27 |
|
|
!! Rotation Matrix for each long range particle in simulation. |
| 28 |
|
|
real( kind = dp), dimension(9, nLocal) :: A |
| 29 |
|
|
!! Unit vectors for dipoles (lab frame) |
| 30 |
|
|
real( kind = dp ), dimension(9,nLocal) :: eFrame |
| 31 |
|
|
!! Force array provided by C, dimensioned by getNlocal |
| 32 |
|
|
real ( kind = dp ), dimension(3,nLocal) :: f |
| 33 |
|
|
!! Torsion array provided by C, dimensioned by getNlocal |
| 34 |
|
|
real( kind = dp ), dimension(3,nLocal) :: t |
| 35 |
gezelter |
507 |
|
| 36 |
gezelter |
264 |
!! Stress Tensor |
| 37 |
|
|
real( kind = dp), dimension(9) :: tau |
| 38 |
gezelter |
662 |
real ( kind = dp ),dimension(LR_POT_TYPES) :: pot |
| 39 |
gezelter |
264 |
logical ( kind = 2) :: do_pot_c, do_stress_c |
| 40 |
|
|
integer :: error |
| 41 |
gezelter |
507 |
|
| 42 |
gezelter |
264 |
call do_force_loop(q, q_group, A, eFrame, f, t, tau, pot, & |
| 43 |
|
|
do_pot_c, do_stress_c, error) |
| 44 |
gezelter |
507 |
|
| 45 |
gezelter |
264 |
end subroutine doForceloop |
| 46 |
gezelter |
586 |
|
| 47 |
chrisfen |
998 |
subroutine getAccumulatedBoxDipole( box_dipole ) |
| 48 |
|
|
|
| 49 |
|
|
use definitions, ONLY: dp |
| 50 |
|
|
use doForces, ONLY: getBoxDipole |
| 51 |
|
|
|
| 52 |
|
|
!! simulation box dipole moment |
| 53 |
|
|
real ( kind = dp ), dimension(3) :: box_dipole |
| 54 |
|
|
|
| 55 |
|
|
call getBoxDipole( box_dipole ) |
| 56 |
|
|
|
| 57 |
|
|
end subroutine getAccumulatedBoxDipole |
| 58 |
|
|
|
| 59 |
|
|
subroutine setAccumulateBoxDipole() |
| 60 |
|
|
|
| 61 |
|
|
use doForces, ONLY: setBoxDipole |
| 62 |
|
|
|
| 63 |
|
|
call setBoxDipole() |
| 64 |
|
|
|
| 65 |
|
|
end subroutine setAccumulateBoxDipole |
| 66 |
|
|
|
| 67 |
gezelter |
809 |
subroutine setFortranElectrostaticMethod(electrostaticMethod) |
| 68 |
gezelter |
762 |
use doForces, ONLY : setElectrostaticMethod |
| 69 |
|
|
|
| 70 |
|
|
integer, intent(in) :: electrostaticMethod |
| 71 |
|
|
|
| 72 |
|
|
call setElectrostaticMethod(electrostaticMethod) |
| 73 |
|
|
|
| 74 |
gezelter |
809 |
end subroutine setFortranElectrostaticMethod |
| 75 |
gezelter |
762 |
|
| 76 |
|
|
subroutine notifyFortranCutoffPolicy(cutPolicy) |
| 77 |
|
|
use doForces, ONLY : setCutoffPolicy |
| 78 |
|
|
|
| 79 |
|
|
integer, intent(in) :: cutPolicy |
| 80 |
|
|
|
| 81 |
|
|
call setCutoffPolicy( cutPolicy ) |
| 82 |
|
|
|
| 83 |
|
|
end subroutine notifyFortranCutoffPolicy |
| 84 |
|
|
|
| 85 |
|
|
subroutine notifyFortranSkinThickness(this_skin) |
| 86 |
|
|
use doForces, ONLY : setSkinThickness |
| 87 |
|
|
use definitions, ONLY : dp |
| 88 |
|
|
|
| 89 |
|
|
real(kind=dp), intent(in) :: this_skin |
| 90 |
|
|
|
| 91 |
|
|
call setSkinThickness( this_skin ) |
| 92 |
|
|
|
| 93 |
|
|
end subroutine notifyFortranSkinThickness |
| 94 |
|
|
|
| 95 |
chrisfen |
1129 |
subroutine notifyFortranCutoffs(this_rcut, this_rsw, this_sp, this_sf) |
| 96 |
gezelter |
762 |
use doForces, ONLY : setCutoffs |
| 97 |
|
|
use definitions, ONLY : dp |
| 98 |
|
|
|
| 99 |
|
|
real(kind=dp), intent(in) :: this_rcut, this_rsw |
| 100 |
chrisfen |
1129 |
logical, intent(in) :: this_sp, this_sf |
| 101 |
gezelter |
762 |
|
| 102 |
chrisfen |
1129 |
call setCutoffs(this_rcut, this_rsw, this_sp, this_sf) |
| 103 |
gezelter |
762 |
|
| 104 |
|
|
end subroutine notifyFortranCutoffs |
| 105 |
|
|
|
| 106 |
|
|
subroutine notifyFortranYouAreOnYourOwn() |
| 107 |
|
|
use doForces, ONLY : cWasLame |
| 108 |
|
|
|
| 109 |
|
|
call cWasLame() |
| 110 |
|
|
end subroutine notifyFortranYouAreOnYourOwn |