From 85135e7c956ab6f65954be10ba7b385a7e799ece Mon Sep 17 00:00:00 2001 From: Alex Selimov Date: Sat, 6 Mar 2021 01:49:29 -0500 Subject: [PATCH] More compatability fixes for new version of CAC --- src/elements.f90 | 2 +- src/io.f90 | 42 +++++++++++++++++++++++++----------------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/elements.f90 b/src/elements.f90 index a70af56..d82c602 100644 --- a/src/elements.f90 +++ b/src/elements.f90 @@ -325,7 +325,7 @@ module elements end if !Check to see if we need to grow the arrays call grow_ele_arrays(0,1) - tag_atom(atom_num) = tag + tag_atom(atom_num) = newtag type_atom(atom_num) = type r_atom(:,atom_num) = r(:) sbox_atom(atom_num) = sbox diff --git a/src/io.f90 b/src/io.f90 index f8dd0b4..2a41072 100644 --- a/src/io.f90 +++ b/src/io.f90 @@ -204,7 +204,7 @@ module io write(11, '(a)') 'Atoms' write(11, '(a)') ' ' do i = 1, atom_num - write(11, '(2i16, 3f23.15)') i, type_atom(i), r_atom(:,i) + write(11, '(2i16, 3f23.15)') tag_atom(i), type_atom(i), r_atom(:,i) end do !Write refined element atomic positions @@ -833,14 +833,16 @@ module io real(kind = dp), dimension(6), intent(out) :: temp_box_bd 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, stat - real(kind=dp) :: newdisplace(3), r_in(3,1,8), r_in_atom(3), atomic_masses(10) - character(len=100) :: textholder, in_lattype_map(10) + atom_type_map(100), etype_map(100), lat_type, new_lattice_map(100), & + atom_type, stat, bnum, nnum, esize, btypes(10), tmp, ip, jp + real(kind=dp) :: newdisplace(3), r_in(3,10,8), r_in_atom(3), atomic_masses(10) + character(len=100) :: textholder, etype character(len=2) :: atomic_element !First open the file open(unit=11, file=trim(adjustl(file)), action='read',position='rewind') + etype = 'fcc' + !Read the timestep information read(11,*) textholder read(11,*) timestep, total_time @@ -866,7 +868,7 @@ module io read(textholder, *) (atomic_masses(i), i=1, j) !Read define atom_types by mass - do i = 1, in_atom_types + do i = 1, j call atommassspecies(atomic_masses(i), atomic_element) call add_atom_type(atomic_element, atom_type_map(i)) end do @@ -876,6 +878,7 @@ module io read(11,*) box_bc !Read box boundaries and displace them if necessary + read(11,*) textholder read(11,*) temp_box_bd(:) do i = 1, 3 if (abs(displace(i)) > lim_zero) then @@ -902,34 +905,39 @@ module io sub_box_bd(:, sub_box_num+1) = temp_box_bd !Read in more useless info - do i = 1, 9 + do i = 1, 4 read(11,*) textholder end do !Now start reading the elements if(in_eles > 0) then + ip = 0 + r_in(:,:,:) = 0 + read(11,*) textholder read(11,*) textholder read(11,*) textholder do i = 1, in_eles - read(11,*) j, etype, k, lat_type + read(11,*) j, bnum, tmp, esize do inod = 1, 8 - read(11, *) k, l, r_in(:,1,inod) - r_in(:,1,inod) = r_in(:,1,inod) + newdisplace + do ibasis = 1, bnum + read(11, *) k, l, btypes(l), r_in(:,l,k-ip) + r_in(:,l,k-ip) = r_in(:,l,k-ip) + newdisplace + end do end do - call add_element(j, in_lattype_map(lat_type), etype_map(etype), new_lattice_map(lat_type), sub_box_num + 1, r_in) + ip = ip + 8 + call lattice_map(bnum, btypes, 8, 1.0_dp, lat_type) + call add_element(j, etype, esize+1, lat_type, sub_box_num + 1, r_in(:,1:max_basisnum, 1:max_ng_node)) end do end if if(in_atoms > 0) then - if (in_eles > 0) then - !Read useless data - read(11,*) textholder - read(11,*) textholder - end if + !Read useless data + read(11,*) textholder + read(11,*) textholder do i = 1, in_atoms - read(11,*, iostat=stat) j, k, atom_type, r_in_atom(:) + read(11,*, iostat=stat) j, atom_type, r_in_atom(:) if(stat > 0) then print *, j stop