merge changes
This commit is contained in:
commit
fa38875296
@ -1,12 +1,12 @@
|
|||||||
FC=gfortran
|
FC=ifort
|
||||||
|
|
||||||
#Ifort flags
|
#Ifort flags
|
||||||
#FFLAGS=-mcmodel=large -g -O0 -stand f08 -fpe0 -traceback -check bounds,uninit -warn all -implicitnone -no-wrap-margin -heap-arrays
|
#FFLAGS=-mcmodel=large -g -O0 -stand f08 -fpe0 -traceback -check bounds,uninit -warn all -implicitnone -no-wrap-margin -heap-arrays
|
||||||
#FFLAGS=-mcmodel=large -Ofast -no-wrap-margin -heap-arrays
|
FFLAGS=-mcmodel=large -Ofast -no-wrap-margin -heap-arrays
|
||||||
|
|
||||||
#gfortran flags
|
#gfortran flags
|
||||||
#FFLAGS=-mcmodel=large -O3 -g
|
#FFLAGS=-mcmodel=large -O3 -g
|
||||||
FFLAGS=-mcmodel=large -O0 -g -fbacktrace -fcheck=all
|
#FFLAGS=-mcmodel=large -O0 -g -fbacktrace -fcheck=all
|
||||||
|
|
||||||
MODES=mode_create.o mode_merge.o mode_convert.o
|
MODES=mode_create.o mode_merge.o mode_convert.o
|
||||||
OPTIONS=opt_disl.o opt_group.o opt_orient.o opt_delete.o opt_deform.o opt_redef_box.o opt_slip_plane.o
|
OPTIONS=opt_disl.o opt_group.o opt_orient.o opt_delete.o opt_deform.o opt_redef_box.o opt_slip_plane.o
|
||||||
|
100
src/elements.f90
100
src/elements.f90
@ -198,64 +198,74 @@ module elements
|
|||||||
|
|
||||||
!The default size we grow the
|
!The default size we grow the
|
||||||
buffer_size = 1024
|
buffer_size = 1024
|
||||||
!Figure out the size of the atom and element arrays
|
|
||||||
ele_size = size(size_ele)
|
|
||||||
atom_size = size(type_atom)
|
|
||||||
|
|
||||||
!Check if we need to grow the ele_size, if so grow all the variables
|
!First check to make sure if it is allocated
|
||||||
if ( n+ele_num > size(size_ele)) then
|
if (allocated(size_ele)) then
|
||||||
|
!Figure out the size of the atom and element arrays
|
||||||
|
ele_size = size(size_ele)
|
||||||
|
|
||||||
allocate(temp_int(n+ele_num+buffer_size))
|
!Check if we need to grow the ele_size, if so grow all the variables
|
||||||
temp_int(1:ele_size) = lat_ele
|
if ( n+ele_size > size(size_ele)) then
|
||||||
temp_int(ele_size+1:) = 0
|
|
||||||
call move_alloc(temp_int, lat_ele)
|
|
||||||
|
|
||||||
allocate(temp_int(n+ele_num+buffer_size))
|
allocate(temp_int(n+ele_size+buffer_size))
|
||||||
temp_int(1:ele_size) = tag_ele(1:ele_size)
|
temp_int(1:ele_size) = lat_ele
|
||||||
temp_int(ele_size+1:) = 0
|
temp_int(ele_size+1:) = 0
|
||||||
call move_alloc(temp_int, tag_ele)
|
call move_alloc(temp_int, lat_ele)
|
||||||
|
|
||||||
allocate(temp_int(n+ele_num+buffer_size))
|
allocate(temp_int(n+ele_size+buffer_size))
|
||||||
temp_int(1:ele_size) = size_ele(1:ele_size)
|
temp_int(1:ele_size) = tag_ele
|
||||||
temp_int(ele_size+1:) = 0
|
temp_int(ele_size+1:) = 0
|
||||||
call move_alloc(temp_int, size_ele)
|
call move_alloc(temp_int, tag_ele)
|
||||||
|
|
||||||
allocate(temp_int(n+ele_num+buffer_size))
|
allocate(temp_int(n+ele_size+buffer_size))
|
||||||
temp_int(1:ele_size) = lat_ele(1:ele_size)
|
temp_int(1:ele_size) = size_ele
|
||||||
temp_int(ele_size+1:) = 0
|
temp_int(ele_size+1:) = 0
|
||||||
call move_alloc(temp_int, sbox_ele)
|
call move_alloc(temp_int, size_ele)
|
||||||
|
|
||||||
allocate(char_temp(n+ele_num+buffer_size))
|
allocate(temp_int(n+ele_size+buffer_size))
|
||||||
char_temp(1:ele_size) = type_ele
|
temp_int(1:ele_size) = sbox_ele(1:ele_size)
|
||||||
call move_alloc(char_temp, type_ele)
|
temp_int(ele_size+1:) = 0
|
||||||
|
call move_alloc(temp_int, sbox_ele)
|
||||||
|
|
||||||
allocate(temp_ele_real(3, max_basisnum, max_ng_node, n+ele_num+buffer_size))
|
allocate(char_temp(n+ele_size+buffer_size))
|
||||||
temp_ele_real(:,:,:,1:ele_size) = r_node
|
char_temp(1:ele_size) = type_ele(1:ele_size)
|
||||||
temp_ele_real(:,:,:,ele_size+1:) = 0.0_dp
|
call move_alloc(char_temp, type_ele)
|
||||||
call move_alloc(temp_ele_real, r_node)
|
|
||||||
|
allocate(temp_ele_real(3, max_basisnum, max_ng_node, n+ele_size+buffer_size))
|
||||||
|
temp_ele_real(:,:,:,1:ele_size) = r_node(:,:,:,1:ele_size)
|
||||||
|
temp_ele_real(:,:,:,ele_size+1:) = 0.0_dp
|
||||||
|
call move_alloc(temp_ele_real, r_node)
|
||||||
|
end if
|
||||||
|
else
|
||||||
|
call alloc_ele_arrays(n,0)
|
||||||
end if
|
end if
|
||||||
|
|
||||||
!Now grow atom arrays if needed
|
!Now grow atom arrays if needed
|
||||||
if (m+atom_num > atom_size) then
|
if (allocated(type_atom)) then
|
||||||
allocate(temp_int(m+atom_num+buffer_size))
|
atom_size = size(type_atom)
|
||||||
temp_int(1:atom_size) = type_atom
|
if (m+atom_num > atom_size) then
|
||||||
temp_int(atom_size+1:) = 0
|
allocate(temp_int(m+atom_size+buffer_size))
|
||||||
call move_alloc(temp_int, type_atom)
|
temp_int(1:atom_size) = type_atom
|
||||||
|
temp_int(atom_size+1:) = 0
|
||||||
|
call move_alloc(temp_int, type_atom)
|
||||||
|
|
||||||
allocate(temp_int(m+atom_num+buffer_size))
|
allocate(temp_int(m+atom_size+buffer_size))
|
||||||
temp_int(1:atom_size) = tag_atom
|
temp_int(1:atom_size) = tag_atom
|
||||||
temp_int(atom_size+1:) = 0
|
temp_int(atom_size+1:) = 0
|
||||||
call move_alloc(temp_int, tag_atom)
|
call move_alloc(temp_int, tag_atom)
|
||||||
|
|
||||||
allocate(temp_int(m+atom_num+buffer_size))
|
allocate(temp_int(m+atom_size+buffer_size))
|
||||||
temp_int(1:atom_size) = sbox_atom
|
temp_int(1:atom_size) = sbox_atom
|
||||||
temp_int(atom_size+1:) = 0
|
temp_int(atom_size+1:) = 0
|
||||||
call move_alloc(temp_int, sbox_atom)
|
call move_alloc(temp_int, sbox_atom)
|
||||||
|
|
||||||
allocate(temp_real(3,m+atom_num+buffer_size))
|
allocate(temp_real(3,m+atom_size+buffer_size))
|
||||||
temp_real(:,1:atom_size) = r_atom
|
temp_real(:,1:atom_size) = r_atom
|
||||||
temp_real(:, atom_size+1:) = 0.0_dp
|
temp_real(:, atom_size+1:) = 0.0_dp
|
||||||
call move_alloc(temp_real, r_atom)
|
call move_alloc(temp_real, r_atom)
|
||||||
|
end if
|
||||||
|
else
|
||||||
|
call alloc_ele_arrays(0,m)
|
||||||
end if
|
end if
|
||||||
end subroutine
|
end subroutine
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user