Performs all the deallocation needed at the end of the calculation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(ommp_system), | intent(inout) | :: | sys_obj |
subroutine mmpol_terminate(sys_obj)
!! Performs all the deallocation needed at the end of the
!! calculation
use mod_memory, only: mfree
use mod_electrostatics, only: electrostatics_terminate
use mod_nonbonded, only: vdw_terminate
use mod_bonded, only: bonded_terminate
implicit none
type(ommp_system), intent(inout) :: sys_obj
call electrostatics_terminate(sys_obj%eel)
deallocate(sys_obj%eel)
call topology_terminate(sys_obj%top)
deallocate(sys_obj%top)
if(sys_obj%use_nonbonded) then
call vdw_terminate(sys_obj%vdw)
sys_obj%use_nonbonded = .false.
end if
if(sys_obj%use_bonded) then
call bonded_terminate(sys_obj%bds)
sys_obj%use_bonded = .false.
end if
sys_obj%mmpol_is_init = .false.
end subroutine mmpol_terminate