Current working changes to control-box code
This commit is contained in:
parent
5949f04103
commit
95e2ad0b4d
6 changed files with 50 additions and 97 deletions
65
src/io.f90
65
src/io.f90
|
@ -583,49 +583,41 @@ module io
|
|||
temp_infile = filename
|
||||
end if
|
||||
|
||||
!Infinite loop which only exists if user provides valid filetype
|
||||
do while(.true.)
|
||||
!Check to see if file exists, if it does then ask user if they would like to overwrite the file
|
||||
inquire(file=trim(temp_infile), exist=file_exists)
|
||||
if (.not.file_exists) then
|
||||
print *, "The file ", trim(adjustl(filename)), " does not exist. Please input an existing file to read."
|
||||
stop 3
|
||||
end if
|
||||
|
||||
!Check to see if file exists, if it does then ask user if they would like to overwrite the file
|
||||
inquire(file=trim(temp_infile), exist=file_exists)
|
||||
if (.not.file_exists) then
|
||||
print *, "The file ", trim(adjustl(filename)), " does not exist. Please input a filename that exists"
|
||||
read(*,*) temp_infile
|
||||
cycle
|
||||
select case(temp_infile(scan(temp_infile,'.',.true.)+1:))
|
||||
case('restart', 'mb', 'cac')
|
||||
infilenum=infilenum+1
|
||||
infiles(infilenum) = temp_infile
|
||||
case('out')
|
||||
if(atom_types == 0) then
|
||||
print *, "Please run -set_types command prior to running code requiring reading in pycac_*.out files"
|
||||
stop 3
|
||||
end if
|
||||
|
||||
select case(temp_infile(scan(temp_infile,'.',.true.)+1:))
|
||||
case('restart', 'mb', 'cac')
|
||||
infilenum=infilenum+1
|
||||
infiles(infilenum) = temp_infile
|
||||
exit
|
||||
case('out')
|
||||
if(atom_types == 0) then
|
||||
print *, "Please run -set_types command prior to running code requiring reading in pycac_*.out files"
|
||||
stop 3
|
||||
end if
|
||||
select case(trim(adjustl(mode)))
|
||||
case('--convert','--metric')
|
||||
infilenum = infilenum+1
|
||||
infiles(infilenum) = temp_infile
|
||||
exit
|
||||
case default
|
||||
print *, "Files of type .out cannot be used with mode ", trim(adjustl(mode))
|
||||
stop 3
|
||||
end select
|
||||
|
||||
case default
|
||||
print *, "File type: ", trim(temp_infile(scan(temp_infile,'.',.true.):)), "not currently accepted. ", &
|
||||
"please input a filename with extension from following list: mb, restart, cac, or out."
|
||||
read(*,*) temp_infile
|
||||
|
||||
select case(trim(adjustl(mode)))
|
||||
case('--convert','--metric')
|
||||
infilenum = infilenum+1
|
||||
infiles(infilenum) = temp_infile
|
||||
case default
|
||||
print *, "Files of type .out cannot be used with mode ", trim(adjustl(mode))
|
||||
stop 3
|
||||
end select
|
||||
end do
|
||||
|
||||
case default
|
||||
print *, "File type: ", trim(temp_infile(scan(temp_infile,'.',.true.):)), "not currently accepted. ", &
|
||||
"please input a filename with extension from following list: mb, restart, cac, or out."
|
||||
stop 3
|
||||
end select
|
||||
|
||||
end subroutine get_in_file
|
||||
|
||||
subroutine read_in(i, displace, temp_box_bd)
|
||||
!This subroutine loops over alll of the outfile types defined and calls the correct writing subroutine
|
||||
!This subroutine reads in file i
|
||||
|
||||
integer, intent(in) :: i
|
||||
real(kind=dp), dimension(3), intent(in) :: displace
|
||||
|
@ -1067,6 +1059,7 @@ module io
|
|||
end do
|
||||
call add_element(tag, fcc, esize+1, lat_type, sub_box_num, re)
|
||||
call add_element_data(ele_num, ee, fe, ve)
|
||||
node_num = node_num + 8
|
||||
end do
|
||||
end if
|
||||
call set_max_esize
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue