diff --git a/src/gfnff/gfnff_ini.f90 b/src/gfnff/gfnff_ini.f90 index 35df19e35..74b8c0b17 100644 --- a/src/gfnff/gfnff_ini.f90 +++ b/src/gfnff/gfnff_ini.f90 @@ -500,7 +500,7 @@ integer function itabrow6(i) write(env%unit,*) 'dEes :',dum1-dum2 write(env%unit,*) 'charge 1/2:',topo%qfrag(1:2) endif - else if (allocated(mol%pdb)) then ! frag_charges_known + else if (allocated(mol%pdb).and.qloop_count.eq.0) then ! frag_charges_known write(env%unit,'(10x,"#fragments for EEQ constrain from pdb file: ",i0)') topo%nfrag frag_charges_known=.true. endif diff --git a/src/gfnff/gfnff_setup.f90 b/src/gfnff/gfnff_setup.f90 index 5b896234f..63a79f856 100644 --- a/src/gfnff/gfnff_setup.f90 +++ b/src/gfnff/gfnff_setup.f90 @@ -21,6 +21,7 @@ module xtb_gfnff_setup use xtb_gfnff_topology, only : TGFFTopology use xtb_gfnff_generator, only : TGFFGenerator implicit none + character(len=*), parameter :: source = 'gfnff_setup' private public :: gfnff_setup, gfnff_input @@ -33,7 +34,6 @@ subroutine gfnff_setup(env,verbose,restart,mol,gen,param,topo,accuracy,version) use xtb_gfnff_param, only : ini, gfnff_set_param use xtb_setparam, only : set implicit none - character(len=*), parameter :: source = 'gfnff_setup' ! Dummy !integer,intent(in) :: ich type(TGFFTopology), intent(inout) :: topo @@ -148,8 +148,11 @@ subroutine gfnff_input(env, mol, topo) write(env%unit,'(10x,"charge from pdb residues: ",i0)') & & nint(sum(topo%qfrag(1:topo%nfrag))) else + ! ignore fragment charges if they are not consistent with the total charge + call env%warning("Fragment charges from PDB file are not consistent with the total charge (is this a manual override?)", source) if (allocated(topo%qpdb)) deallocate(topo%qpdb) - topo%qfrag(1:topo%nfrag) = 0.0_wp + topo%qfrag(1) = mol%chrg + topo%qfrag(2:topo%nfrag) = 0.0_wp topo%nfrag = 0 end if !--------------------------------------------------------------------