|
|
@ -635,7 +635,7 @@ module io
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
select case(temp_infile(scan(temp_infile,'.',.true.)+1:))
|
|
|
|
select case(temp_infile(scan(temp_infile,'.',.true.)+1:))
|
|
|
|
case('restart', 'mb', 'cac')
|
|
|
|
case('lmp','restart', 'mb', 'cac')
|
|
|
|
infilenum=infilenum+1
|
|
|
|
infilenum=infilenum+1
|
|
|
|
infiles(infilenum) = temp_infile
|
|
|
|
infiles(infilenum) = temp_infile
|
|
|
|
case('out')
|
|
|
|
case('out')
|
|
|
@ -673,6 +673,8 @@ module io
|
|
|
|
call read_mb(infiles(i), displace, temp_box_bd)
|
|
|
|
call read_mb(infiles(i), displace, temp_box_bd)
|
|
|
|
case('restart')
|
|
|
|
case('restart')
|
|
|
|
call read_pycac(infiles(i), displace, temp_box_bd)
|
|
|
|
call read_pycac(infiles(i), displace, temp_box_bd)
|
|
|
|
|
|
|
|
case('lmp')
|
|
|
|
|
|
|
|
call read_lmp(infiles(i), displace, temp_box_bd)
|
|
|
|
case('cac')
|
|
|
|
case('cac')
|
|
|
|
call read_lmpcac(infiles(i), displace, temp_box_bd)
|
|
|
|
call read_lmpcac(infiles(i), displace, temp_box_bd)
|
|
|
|
case('out')
|
|
|
|
case('out')
|
|
|
@ -1053,7 +1055,88 @@ module io
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end subroutine
|
|
|
|
end subroutine
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subroutine read_lmp(file, displace, temp_box_bd)
|
|
|
|
|
|
|
|
!This subroutine is used to read .cac files which are used with the lammpsCAC format
|
|
|
|
|
|
|
|
character(len=100), intent(in) :: file
|
|
|
|
|
|
|
|
real(kind=dp), dimension(3), intent(in) :: displace
|
|
|
|
|
|
|
|
real(kind = dp), dimension(6), intent(out) :: temp_box_bd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
character(len=100) :: textholder, element_type
|
|
|
|
|
|
|
|
character(len=2) :: atom_species
|
|
|
|
|
|
|
|
integer :: i, j, k, atom_in, type_in, type_map(10), in_basis, node_types(10,8), &
|
|
|
|
|
|
|
|
lat_type, id
|
|
|
|
|
|
|
|
real(kind=dp) :: mass, r_in(3), newdisplace(3)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!Open the file
|
|
|
|
|
|
|
|
open(unit=11, file=trim(adjustl(file)), action='read',position='rewind')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!Now initialize some important variables if they aren't defined
|
|
|
|
|
|
|
|
if (max_basisnum==0) max_basisnum = 10
|
|
|
|
|
|
|
|
if (max_ng_node==0) max_ng_node=8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!Read header information
|
|
|
|
|
|
|
|
read(11, *) textholder
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!Read number of elements
|
|
|
|
|
|
|
|
read(11, *) atom_in, textholder
|
|
|
|
|
|
|
|
read(11, *) type_in, textholder
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!Read box_boundaries
|
|
|
|
|
|
|
|
read(11,*) temp_box_bd(1:2), textholder, textholder
|
|
|
|
|
|
|
|
read(11,*) temp_box_bd(3:4), textholder, textholder
|
|
|
|
|
|
|
|
read(11,*) temp_box_bd(5:6), textholder, textholder
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print *, "Read in ", atom_in, " atoms from ", trim(adjustl(file))
|
|
|
|
|
|
|
|
!Shift the box boundaries if needed
|
|
|
|
|
|
|
|
do i = 1, 3
|
|
|
|
|
|
|
|
if (abs(displace(i)) > lim_zero) then
|
|
|
|
|
|
|
|
newdisplace(i) = displace(i) - temp_box_bd(2*i-1)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
newdisplace(i)=displace(i)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
temp_box_bd(2*i-1) = temp_box_bd(2*i-1) + newdisplace(i)
|
|
|
|
|
|
|
|
temp_box_bd(2*i) = temp_box_bd(2*i) + newdisplace(i)
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!Grow box boundaries
|
|
|
|
|
|
|
|
call grow_box(temp_box_bd)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!Allocate sub_box
|
|
|
|
|
|
|
|
if (sub_box_num == 0) then
|
|
|
|
|
|
|
|
call alloc_sub_box(1)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call grow_sub_box(1)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!Because orientations and other needed sub_box information isn't really
|
|
|
|
|
|
|
|
!present within the .cac file we just default a lot of it.
|
|
|
|
|
|
|
|
sub_box_ori(:,:,sub_box_num+1) = identity_mat(3)
|
|
|
|
|
|
|
|
sub_box_bd(:, sub_box_num+1) = temp_box_bd
|
|
|
|
|
|
|
|
sub_box_num = sub_box_num + 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!Read useless information
|
|
|
|
|
|
|
|
read(11,*) textholder
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!Read atomic masses
|
|
|
|
|
|
|
|
do i = 1, type_in
|
|
|
|
|
|
|
|
read(11,*) j, mass, textholder
|
|
|
|
|
|
|
|
call ATOMMASSSPECIES(mass, atom_species)
|
|
|
|
|
|
|
|
call add_atom_type(atom_species, type_map(i))
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!Read useless info
|
|
|
|
|
|
|
|
read(11,*) textholder
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!Start the reading loop
|
|
|
|
|
|
|
|
do i = 1, atom_in
|
|
|
|
|
|
|
|
read(11,*) id, type_in, r_in(:)
|
|
|
|
|
|
|
|
call add_atom(id, type_in, sub_box_num, r_in)
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
close(11)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
end subroutine read_lmp
|
|
|
|
|
|
|
|
|
|
|
|
subroutine read_lmpcac(file, displace, temp_box_bd)
|
|
|
|
subroutine read_lmpcac(file, displace, temp_box_bd)
|
|
|
|
!This subroutine is used to read .cac files which are used with the lammpsCAC format
|
|
|
|
!This subroutine is used to read .cac files which are used with the lammpsCAC format
|
|
|
|