Add all new option

development
Alex Selimov 3 years ago
parent 4b9589e7b3
commit 8fd45dc461

@ -64,6 +64,8 @@ module caller
arg_pos = arg_pos + 1 arg_pos = arg_pos + 1
case('-norefine') case('-norefine')
arg_pos = arg_pos + 1 arg_pos = arg_pos + 1
case('all_new')
arg_pos = arg_pos + 1
case('-orient') case('-orient')
call orient_opt(arg_pos) call orient_opt(arg_pos)
case('-unorient') case('-unorient')

@ -332,15 +332,24 @@ module elements
end subroutine add_atom end subroutine add_atom
subroutine add_atom_type(type, inttype) subroutine add_atom_type(type, inttype, force_new)
!This subroutine adds a new atom type to the module list of atom types !This subroutine adds a new atom type to the module list of atom types
character(len=2), intent(in) :: type character(len=2), intent(in) :: type
integer, intent(out) :: inttype integer, intent(out) :: inttype
logical, optional, intent(in) :: force_new
integer :: i integer :: i
logical :: exists logical :: exists, force
if(present(force_new)) then
force = force_new
else
force = .false.
end if
exists = .false. exists = .false.
if(.not.force) then
do i=1, 10 do i=1, 10
if(type == type_to_name(i)) then if(type == type_to_name(i)) then
exists = .true. exists = .true.
@ -348,6 +357,7 @@ module elements
exit exit
end if end if
end do end do
end if
if (exists.eqv..false.) then if (exists.eqv..false.) then
atom_types = atom_types+1 atom_types = atom_types+1

@ -10,7 +10,7 @@ module io
integer :: outfilenum = 0, infilenum = 0 integer :: outfilenum = 0, infilenum = 0
character(len=100) :: outfiles(100), infiles(100), in_lattice_type='' character(len=100) :: outfiles(100), infiles(100), in_lattice_type=''
logical :: force_overwrite, norefine logical :: force_overwrite, norefine, all_new
real(kind=dp) :: in_lapa=0.0 real(kind=dp) :: in_lapa=0.0
public public
contains contains
@ -772,7 +772,7 @@ module io
!Now fit these into the global list of atom types, after this new_type_to_type is the actual global !Now fit these into the global list of atom types, after this new_type_to_type is the actual global
!type of the atoms within this file !type of the atoms within this file
do i = 1, new_atom_types do i = 1, new_atom_types
call add_atom_type(new_type_to_name(i), new_type_to_type(i)) call add_atom_type(new_type_to_name(i), new_type_to_type(i), all_new)
end do end do
!Read the number of lattice types, basisnum, and number of nodes for each lattice type !Read the number of lattice types, basisnum, and number of nodes for each lattice type
read(11,*) new_lattice_types, (basisnum(i), i = lattice_types+1, lattice_types+new_lattice_types), & read(11,*) new_lattice_types, (basisnum(i), i = lattice_types+1, lattice_types+new_lattice_types), &
@ -903,7 +903,7 @@ module io
print *, j print *, j
do i = 1, j do i = 1, j
call atommassspecies(atomic_masses(i), atomic_element) call atommassspecies(atomic_masses(i), atomic_element)
call add_atom_type(atomic_element, atom_type_map(i)) call add_atom_type(atomic_element, atom_type_map(i), all_new)
print *, i, atom_type_map(i) print *, i, atom_type_map(i)
end do end do
@ -1057,7 +1057,7 @@ module io
!Read define atom_types by mass !Read define atom_types by mass
do i = 1, j do i = 1, j
call atommassspecies(atomic_masses(i), atomic_element) call atommassspecies(atomic_masses(i), atomic_element)
call add_atom_type(atomic_element, atom_type_map(i)) call add_atom_type(atomic_element, atom_type_map(i), all_new)
end do end do
@ -1171,7 +1171,7 @@ module io
do i = 1, type_in do i = 1, type_in
read(11,*) j, mass read(11,*) j, mass
call ATOMMASSSPECIES(mass, atom_species) call ATOMMASSSPECIES(mass, atom_species)
call add_atom_type(atom_species, type_map(i)) call add_atom_type(atom_species, type_map(i), all_new)
end do end do
!Read useless info !Read useless info
@ -1259,7 +1259,7 @@ module io
do i = 1, type_in do i = 1, type_in
read(11,*) j, mass, textholder read(11,*) j, mass, textholder
call ATOMMASSSPECIES(mass, atom_species) call ATOMMASSSPECIES(mass, atom_species)
call add_atom_type(atom_species, type_map(i)) call add_atom_type(atom_species, type_map(i), all_new)
end do end do
!Read useless info !Read useless info

@ -42,6 +42,7 @@ program main
force_overwrite=.false. force_overwrite=.false.
norefine=.false. norefine=.false.
wrap_flag = .false. wrap_flag = .false.
all_new = .false.
end_mode_arg = 0 end_mode_arg = 0
@ -70,6 +71,8 @@ program main
call set_cac(i) call set_cac(i)
case('-set_types') case('-set_types')
call set_types(i) call set_types(i)
case('-all_new')
all_new=.true.
end select end select
end do end do
!Determine if a mode is being used and what it is. The first argument has to be the mode !Determine if a mode is being used and what it is. The first argument has to be the mode

Loading…
Cancel
Save