-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mdstep refactor #108
Mdstep refactor #108
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
module mod_mdstep | ||
use mod_const, only: DP | ||
use mod_utils, only: abinerror | ||
use mod_general, only: update_simtime | ||
use mod_transform | ||
implicit none | ||
private | ||
|
@@ -36,21 +37,17 @@ module mod_mdstep | |
end type | ||
|
||
abstract interface | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gettting a bit fancy here, here's a nice explanation: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a cool trick. 'Hello pointers my old friend.' There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah. The good thing here is that the logic for selecting the integrator is localized in one place, whereas before it was both in init.F90 and abin.F90. |
||
subroutine integrator(x, y, z, px, py, pz, amt, dt, f, e) | ||
import :: DP, energies, forces | ||
subroutine integrator(x, y, z, px, py, pz, amt, dt, E_pot, fx, fy, fz) | ||
import :: DP | ||
real(DP), dimension(:, :), intent(inout) :: x, y, z, px, py, pz | ||
real(DP), dimension(:, :), intent(in) :: amt | ||
type(forces), intent(inout) :: f | ||
type(energies), intent(inout) :: e | ||
real(DP), intent(in) :: dt | ||
real(DP), intent(inout) :: E_pot | ||
real(DP), dimension(:, :), intent(inout) :: fx, fy, fz | ||
end subroutine integrator | ||
! subroutine verle(x, y, z, px, py, pz, amt, dt, eclas, fxc, fyc, fzc) | ||
! subroutine respa(x, y, z, px, py, pz, amt, amg, dt, equant, eclas, fxc, fyc, fzc, fxq, fyq, fzq) | ||
! subroutine shake(x, y, z, px, py, pz, amt, amg, dt, equant, eclas, fxc, fyc, fzc, fxq, fyq, fzq) | ||
! subroutine dresp(x, y, z, px, py, pz, amt, amg, dt, equant, eclas, fxc, fyc, fzc, fxq, fyq, fzq) | ||
end interface | ||
|
||
procedure(integrator), public :: mdstep | ||
procedure(integrator), pointer, public :: mdstep | ||
|
||
contains | ||
|
||
|
@@ -276,6 +273,7 @@ subroutine verletstep(x, y, z, px, py, pz, amt, dt, eclas, fxc, fyc, fzc) | |
|
||
if (inose > 0) call thermostat(px, py, pz, amt, dt / 2) | ||
|
||
call update_simtime(dt) | ||
end subroutine verletstep | ||
|
||
! RESPA ALGORITHM 10.12.2012 | ||
|
@@ -322,6 +320,7 @@ subroutine respastep(x, y, z, px, py, pz, amt, amg, dt, equant, eclas, & | |
|
||
call thermostat(px, py, pz, amt, dt / (2 * nabin)) | ||
|
||
call update_simtime(dt) | ||
end subroutine respastep | ||
|
||
! RESPA ALGORITHM WITH RATTLE 10.12.2012 | ||
|
@@ -406,6 +405,7 @@ subroutine respashake(x, y, z, px, py, pz, amt, amg, dt, equant, eclas, & | |
|
||
if (inose == 1) call shiftNHC_yosh(px, py, pz, amt, dt / (2 * nabin)) | ||
|
||
call update_simtime(dt) | ||
end subroutine respashake | ||
|
||
! Double RESPA algorithm using reference low-cost potential pot_ref with smaller time step | ||
|
@@ -467,6 +467,7 @@ subroutine doublerespastep(x, y, z, px, py, pz, amt, amg, dt, equant, eclas, & | |
|
||
if (inose > 0) call thermostat(px, py, pz, amt, dtsm / 2) | ||
|
||
call update_simtime(dt) | ||
end subroutine doublerespastep | ||
|
||
end module mod_mdstep |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the CPU time printing, because it's not indicative of anything as it does not account for external program execution.