Skip to content

Commit

Permalink
fixed a bug of double allocate num_atoms_eachtype in readinput.f90
Browse files Browse the repository at this point in the history
  • Loading branch information
quanshengwu committed Oct 10, 2018
1 parent da6b196 commit 1a78725
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions soc/readinput.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2002,9 +2002,13 @@ subroutine readinput
221 continue

if (lfound) then
read(1001,*)Num_atom_type
read(1001,*)it
if (it/=Num_atom_type) then
write(*, '(a)')"ERROR: Number of atom's type in ATOM_MASS card should be consistent with the atomic_position card"
stop
endif
if(cpuid==0)write(stdout,'(a,i10,a)')'There are', Num_atom_type, 'kind of atoms'
allocate(Num_atoms_eachtype(Num_atom_type))
if (.not.allocated(Num_atoms_eachtype))allocate(Num_atoms_eachtype(Num_atom_type))
allocate(mass_temp(Num_atom_type))
allocate(ATOM_MASS(Num_atoms))
read(1001,*)Num_atoms_eachtype(1:Num_atom_type)
Expand Down

0 comments on commit 1a78725

Please sign in to comment.