main.f90 Source File


This file depends on

sourcefile~~main.f90~~EfferentGraph sourcefile~main.f90 main.f90 sourcefile~m_control_io.f90 m_control_io.f90 sourcefile~main.f90->sourcefile~m_control_io.f90 sourcefile~m_globals.f90 m_globals.f90 sourcefile~main.f90->sourcefile~m_globals.f90 sourcefile~m_logger.f90 m_logger.f90 sourcefile~main.f90->sourcefile~m_logger.f90 sourcefile~m_mc_solver.f90 m_mc_solver.f90 sourcefile~main.f90->sourcefile~m_mc_solver.f90 sourcefile~m_precision.f90 m_precision.f90 sourcefile~main.f90->sourcefile~m_precision.f90 sourcefile~m_setup.f90 m_setup.f90 sourcefile~main.f90->sourcefile~m_setup.f90 sourcefile~m_strings.f90 m_strings.f90 sourcefile~main.f90->sourcefile~m_strings.f90 sourcefile~m_control_io.f90->sourcefile~m_globals.f90 sourcefile~m_control_io.f90->sourcefile~m_precision.f90 sourcefile~m_control_io.f90->sourcefile~m_strings.f90 sourcefile~m_globals.f90->sourcefile~m_precision.f90 sourcefile~m_ia_types.f90 m_ia_types.f90 sourcefile~m_globals.f90->sourcefile~m_ia_types.f90 sourcefile~m_trajectory.f90 m_trajectory.f90 sourcefile~m_globals.f90->sourcefile~m_trajectory.f90 sourcefile~m_timestamp.f90 m_timestamp.f90 sourcefile~m_logger.f90->sourcefile~m_timestamp.f90 sourcefile~m_mc_solver.f90->sourcefile~m_globals.f90 sourcefile~m_mc_solver.f90->sourcefile~m_logger.f90 sourcefile~m_mc_solver.f90->sourcefile~m_precision.f90 sourcefile~m_mc_solver.f90->sourcefile~m_strings.f90 sourcefile~m_config_io.f90 m_config_io.f90 sourcefile~m_mc_solver.f90->sourcefile~m_config_io.f90 sourcefile~m_constants_math.f90 m_constants_math.f90 sourcefile~m_mc_solver.f90->sourcefile~m_constants_math.f90 sourcefile~m_interaction.f90 m_interaction.f90 sourcefile~m_mc_solver.f90->sourcefile~m_interaction.f90 sourcefile~m_mc_moves.f90 m_mc_moves.f90 sourcefile~m_mc_solver.f90->sourcefile~m_mc_moves.f90 sourcefile~m_nbr_lists.f90 m_nbr_lists.f90 sourcefile~m_mc_solver.f90->sourcefile~m_nbr_lists.f90 sourcefile~m_stats_io.f90 m_stats_io.f90 sourcefile~m_mc_solver.f90->sourcefile~m_stats_io.f90 sourcefile~m_setup.f90->sourcefile~m_globals.f90 sourcefile~m_setup.f90->sourcefile~m_logger.f90 sourcefile~m_setup.f90->sourcefile~m_mc_solver.f90 sourcefile~m_setup.f90->sourcefile~m_precision.f90 sourcefile~m_setup.f90->sourcefile~m_config_io.f90 sourcefile~m_setup.f90->sourcefile~m_interaction.f90 sourcefile~m_ran_num.f90 m_ran_num.f90 sourcefile~m_setup.f90->sourcefile~m_ran_num.f90 sourcefile~m_setup.f90->sourcefile~m_stats_io.f90 sourcefile~m_strings.f90->sourcefile~m_precision.f90 sourcefile~m_config_io.f90->sourcefile~m_globals.f90 sourcefile~m_config_io.f90->sourcefile~m_precision.f90 sourcefile~m_config_io.f90->sourcefile~m_strings.f90 sourcefile~m_constants_math.f90->sourcefile~m_precision.f90 sourcefile~m_ia_types.f90->sourcefile~m_precision.f90 sourcefile~m_interaction.f90->sourcefile~m_globals.f90 sourcefile~m_interaction.f90->sourcefile~m_precision.f90 sourcefile~m_interaction.f90->sourcefile~m_constants_math.f90 sourcefile~m_interaction.f90->sourcefile~m_nbr_lists.f90 sourcefile~m_ia_angle.f90 m_ia_angle.f90 sourcefile~m_interaction.f90->sourcefile~m_ia_angle.f90 sourcefile~m_ia_bond.f90 m_ia_bond.f90 sourcefile~m_interaction.f90->sourcefile~m_ia_bond.f90 sourcefile~m_ia_dihedral.f90 m_ia_dihedral.f90 sourcefile~m_interaction.f90->sourcefile~m_ia_dihedral.f90 sourcefile~m_ia_external.f90 m_ia_external.f90 sourcefile~m_interaction.f90->sourcefile~m_ia_external.f90 sourcefile~m_ia_tether.f90 m_ia_tether.f90 sourcefile~m_interaction.f90->sourcefile~m_ia_tether.f90 sourcefile~m_ia_vdw.f90 m_ia_vdw.f90 sourcefile~m_interaction.f90->sourcefile~m_ia_vdw.f90 sourcefile~m_qsort.f90 m_qsort.f90 sourcefile~m_interaction.f90->sourcefile~m_qsort.f90 sourcefile~m_mc_moves.f90->sourcefile~m_globals.f90 sourcefile~m_mc_moves.f90->sourcefile~m_precision.f90 sourcefile~m_mc_moves.f90->sourcefile~m_constants_math.f90 sourcefile~m_mc_moves.f90->sourcefile~m_interaction.f90 sourcefile~m_mc_moves.f90->sourcefile~m_nbr_lists.f90 sourcefile~m_mc_moves.f90->sourcefile~m_ran_num.f90 sourcefile~m_nbr_lists.f90->sourcefile~m_globals.f90 sourcefile~m_nbr_lists.f90->sourcefile~m_precision.f90 sourcefile~m_table.f90 m_table.f90 sourcefile~m_nbr_lists.f90->sourcefile~m_table.f90 sourcefile~m_vector.f90 m_vector.f90 sourcefile~m_nbr_lists.f90->sourcefile~m_vector.f90 sourcefile~m_ran_num.f90->sourcefile~m_precision.f90 sourcefile~m_stats_io.f90->sourcefile~m_globals.f90 sourcefile~m_stats_io.f90->sourcefile~m_precision.f90 sourcefile~m_stats_io.f90->sourcefile~m_strings.f90 sourcefile~m_stats_io.f90->sourcefile~m_constants_math.f90 sourcefile~m_trajectory.f90->sourcefile~m_precision.f90 sourcefile~m_ia_angle.f90->sourcefile~m_precision.f90 sourcefile~m_ia_angle.f90->sourcefile~m_constants_math.f90 sourcefile~m_ia_angle.f90->sourcefile~m_ia_types.f90 sourcefile~m_spline.f90 m_spline.f90 sourcefile~m_ia_angle.f90->sourcefile~m_spline.f90 sourcefile~m_ia_bond.f90->sourcefile~m_precision.f90 sourcefile~m_ia_bond.f90->sourcefile~m_constants_math.f90 sourcefile~m_ia_bond.f90->sourcefile~m_ia_types.f90 sourcefile~m_ia_bond.f90->sourcefile~m_spline.f90 sourcefile~m_ia_dihedral.f90->sourcefile~m_precision.f90 sourcefile~m_ia_dihedral.f90->sourcefile~m_constants_math.f90 sourcefile~m_ia_dihedral.f90->sourcefile~m_ia_types.f90 sourcefile~m_ia_external.f90->sourcefile~m_precision.f90 sourcefile~m_ia_external.f90->sourcefile~m_constants_math.f90 sourcefile~m_ia_external.f90->sourcefile~m_ia_types.f90 sourcefile~m_ia_tether.f90->sourcefile~m_precision.f90 sourcefile~m_ia_tether.f90->sourcefile~m_constants_math.f90 sourcefile~m_ia_tether.f90->sourcefile~m_ia_types.f90 sourcefile~m_ia_vdw.f90->sourcefile~m_precision.f90 sourcefile~m_ia_vdw.f90->sourcefile~m_constants_math.f90 sourcefile~m_ia_vdw.f90->sourcefile~m_ia_types.f90 sourcefile~m_ia_vdw.f90->sourcefile~m_spline.f90 sourcefile~m_qsort.f90->sourcefile~m_precision.f90 sourcefile~m_table.f90->sourcefile~m_precision.f90 sourcefile~m_table.f90->sourcefile~m_vector.f90 sourcefile~m_vector.f90->sourcefile~m_precision.f90 sourcefile~m_vector.f90->sourcefile~m_qsort.f90

Source Code

program main

use m_precision
use m_strings
use m_logger
use m_globals, only: job_tag
use m_control_io, only: read_control, write_control
use m_setup, only: setup, finish
use m_mc_solver, only: mcs_run

implicit none

!*******************************************************************************

character(len=64) :: cla
character(len=:), allocatable :: key
character(len=:), allocatable :: val
character(len=:), allocatable :: fn_control
character(len=512) :: msg
real(rp):: t_start, t_end
integer :: ierr
integer :: icla
integer :: ncla ! number of command line arguments, without the command name

!Two command line arguments may be provided -- (i) fn_control=val and 
!(ii) job_tag=val

fn_control = 'control.txt'

ncla = command_argument_count()
do icla = 1, ncla
    call get_command_argument(icla, value=cla, status=ierr)
    if (ierr > 0) then
        write(*, '(a,1x,i0)') "read failure for command argument", icla
        stop
    else if (ierr == -1) then
        write(*, '(a,1x,i0)') "command argument truncated", icla
        stop
    end if

    call str_get_keyval(cla, key, val, '=')
    if (key == 'fn_control') then
        fn_control = val
    else if (key == 'job_tag') then
        job_tag = '.'//val
    end if
end do

call logger%init('mcpak.log'//job_tag, .true.)

call cpu_time(t_start)

call read_control(fn_control)

call setup()

call mcs_run(ierr)

call cpu_time(t_end)

write(msg,'(f0.6)') (t_end-t_start)

call logger%log_msg('Total execution time (s): ' // trim(adjustl(msg)))

call finish()

!*******************************************************************************

end program