Added deform box option and allowed for reading time information from restart files
This commit is contained in:
parent
8d939ed942
commit
724e573287
6 changed files with 117 additions and 11 deletions
20
src/io.f90
20
src/io.f90
|
@ -491,7 +491,7 @@ module io
|
|||
exit
|
||||
endif
|
||||
end do
|
||||
write(11, '(4i16)') i, etype, 1, basis_type(1,lat_ele(i))
|
||||
write(11, '(4i16)') tag_ele(i), etype, 1, basis_type(1,lat_ele(i))
|
||||
do inod = 1, ng_node(lat_ele(i))
|
||||
do ibasis = 1, basisnum(lat_ele(i))
|
||||
ip = ip + 1
|
||||
|
@ -505,7 +505,7 @@ module io
|
|||
if(atom_num /= 0) then
|
||||
write(11,14)
|
||||
do i = 1, atom_num
|
||||
write(11, '(3i16, 3f23.15)') i, 1, type_atom(i), r_atom(:,i)
|
||||
write(11, '(3i16, 3f23.15)') tag_atom(i), 1, type_atom(i), r_atom(:,i)
|
||||
end do
|
||||
end if
|
||||
|
||||
|
@ -781,19 +781,19 @@ module io
|
|||
|
||||
integer :: i, inod, ibasis, j, k, l, in_eles, in_atoms, ele_types, in_lat_num, in_atom_types, &
|
||||
atom_type_map(100), etype_map(100), etype, lat_type, new_lattice_map(100), &
|
||||
atom_type
|
||||
atom_type, stat
|
||||
real(kind=dp) :: newdisplace(3), r_in(3,1,8), r_in_atom(3)
|
||||
character(len=100) :: textholder, in_lattype_map(10)
|
||||
character(len=2) :: atomic_element
|
||||
!First open the file
|
||||
open(unit=11, file=trim(adjustl(file)), action='read',position='rewind')
|
||||
|
||||
!Disregard unneeded information
|
||||
do i = 1, 3
|
||||
read(11,*) textholder
|
||||
end do
|
||||
!Read the timestep information
|
||||
read(11,*) textholder
|
||||
read(11,*) timestep, total_time
|
||||
|
||||
!Read element number
|
||||
read(11,*) textholder
|
||||
read(11,*) in_eles
|
||||
|
||||
!Discard info and read ng_max_node
|
||||
|
@ -941,7 +941,11 @@ module io
|
|||
end if
|
||||
|
||||
do i = 1, in_atoms
|
||||
read(11,*) j, k, atom_type, r_in_atom(:)
|
||||
read(11,*, iostat=stat) j, k, atom_type, r_in_atom(:)
|
||||
if(stat > 0) then
|
||||
print *, j
|
||||
stop
|
||||
end if
|
||||
r_in_atom = r_in_atom + newdisplace
|
||||
call add_atom(j,atom_type_map(atom_type), sub_box_num + 1, r_in_atom)
|
||||
end do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue