program main !**************************** CACmb ******************************* !* CAC model building toolkit * ! ____________ * ! / / * ! / / * ! /___________/ * ! _|_ _|_ _|____________ * ! / / * ! / / * ! /___________/ * ! * !******************************************************************* use parameters use elements use io integer :: i, end_mode_arg, arg_num character(len=100) :: argument !Call initialization functions call lattice_init call box_init ! Command line parsing arg_num = command_argument_count() !Determine if a mode is being used and what it is. The first argument has to be the mode !if a mode is being used call get_command_argument(1, argument) argument = trim(adjustl(argument)) if (argument(1:2) == '--') then call call_mode(end_mode_arg, argument) 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) !Check to see if a filename was passed if(scan(argument,'.',.true.) > 0) then call get_out_file(argument) end if end do !Check to make sure a file was passed to be written out and then write out ! Before building do a check on the file if (outfilenum == 0) then argument = 'none' call get_out_file(argument) end if call write_out end program main