Merge branch 'ft--opt-dislloop' into development
This commit is contained in:
commit
c89b7d3b59
11 changed files with 788 additions and 35 deletions
24
src/main.f90
24
src/main.f90
|
@ -17,12 +17,13 @@ program main
|
|||
use io
|
||||
|
||||
|
||||
integer :: i, end_mode_arg, arg_num
|
||||
integer :: i, end_mode_arg, arg_num, arg_pos
|
||||
character(len=100) :: argument
|
||||
|
||||
!Call initialization functions
|
||||
call lattice_init
|
||||
call box_init
|
||||
end_mode_arg = 0
|
||||
|
||||
! Command line parsing
|
||||
arg_num = command_argument_count()
|
||||
|
@ -47,13 +48,30 @@ program main
|
|||
call call_mode(end_mode_arg, argument)
|
||||
end if
|
||||
|
||||
!Check to make sure a mode was called
|
||||
if (end_mode_arg==0) then
|
||||
stop "Nothing to do, please run cacmb using an available mode"
|
||||
end if
|
||||
!Now we loop through all of the arguments and check for passed options or for a filename to be written out
|
||||
do i = end_mode_arg-1, arg_num
|
||||
call get_command_argument(i, argument)
|
||||
arg_pos = end_mode_arg
|
||||
do while(.true.)
|
||||
!Exit the loop if we are done reading
|
||||
if(arg_pos > arg_num) exit
|
||||
|
||||
call get_command_argument(arg_pos, argument)
|
||||
|
||||
!Check to see if a filename was passed
|
||||
if(scan(argument,'.',.true.) > 0) then
|
||||
call get_out_file(argument)
|
||||
arg_pos = arg_pos + 1
|
||||
|
||||
!Check to see if an option has been passed
|
||||
else if(argument(1:1) == '-') then
|
||||
call call_option(argument, arg_pos)
|
||||
!Otherwise print that the argument is not accepted and move on
|
||||
else
|
||||
print *, trim(adjustl(argument)), " is not accepted. Skipping to next argument"
|
||||
arg_pos = arg_pos + 1
|
||||
end if
|
||||
end do
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue