main.f90 Source File


This file depends on

sourcefile~~main.f90~~EfferentGraph sourcefile~main.f90 main.f90 sourcefile~logger_m.f90 logger_m.f90 sourcefile~main.f90->sourcefile~logger_m.f90 sourcefile~setup_m.f90 setup_m.f90 sourcefile~main.f90->sourcefile~setup_m.f90 sourcefile~control_m.f90 control_m.f90 sourcefile~main.f90->sourcefile~control_m.f90 sourcefile~constants_m.f90 constants_m.f90 sourcefile~main.f90->sourcefile~constants_m.f90 sourcefile~strings_m.f90 strings_m.f90 sourcefile~main.f90->sourcefile~strings_m.f90 sourcefile~timestamp_m.f90 timestamp_m.f90 sourcefile~logger_m.f90->sourcefile~timestamp_m.f90 sourcefile~setup_m.f90->sourcefile~logger_m.f90 sourcefile~setup_m.f90->sourcefile~control_m.f90 sourcefile~setup_m.f90->sourcefile~constants_m.f90 sourcefile~setup_m.f90->sourcefile~strings_m.f90 sourcefile~config_io_m.f90 config_io_m.f90 sourcefile~setup_m.f90->sourcefile~config_io_m.f90 sourcefile~atmcfg_m.f90 atmcfg_m.f90 sourcefile~setup_m.f90->sourcefile~atmcfg_m.f90 sourcefile~stats_m.f90 stats_m.f90 sourcefile~setup_m.f90->sourcefile~stats_m.f90 sourcefile~bd_solver_m.f90 bd_solver_m.f90 sourcefile~setup_m.f90->sourcefile~bd_solver_m.f90 sourcefile~trajectory_m.f90 trajectory_m.f90 sourcefile~setup_m.f90->sourcefile~trajectory_m.f90 sourcefile~random_m.f90 random_m.f90 sourcefile~setup_m.f90->sourcefile~random_m.f90 sourcefile~interaction_m.f90 interaction_m.f90 sourcefile~setup_m.f90->sourcefile~interaction_m.f90 sourcefile~simbox_m.f90 simbox_m.f90 sourcefile~setup_m.f90->sourcefile~simbox_m.f90 sourcefile~control_m.f90->sourcefile~constants_m.f90 sourcefile~control_m.f90->sourcefile~strings_m.f90 sourcefile~strings_m.f90->sourcefile~constants_m.f90 sourcefile~config_io_m.f90->sourcefile~constants_m.f90 sourcefile~config_io_m.f90->sourcefile~strings_m.f90 sourcefile~config_io_m.f90->sourcefile~atmcfg_m.f90 sourcefile~config_io_m.f90->sourcefile~simbox_m.f90 sourcefile~atmcfg_m.f90->sourcefile~constants_m.f90 sourcefile~stats_m.f90->sourcefile~control_m.f90 sourcefile~stats_m.f90->sourcefile~constants_m.f90 sourcefile~stats_m.f90->sourcefile~strings_m.f90 sourcefile~stats_m.f90->sourcefile~atmcfg_m.f90 sourcefile~stats_m.f90->sourcefile~simbox_m.f90 sourcefile~bd_solver_m.f90->sourcefile~logger_m.f90 sourcefile~bd_solver_m.f90->sourcefile~control_m.f90 sourcefile~bd_solver_m.f90->sourcefile~constants_m.f90 sourcefile~bd_solver_m.f90->sourcefile~config_io_m.f90 sourcefile~bd_solver_m.f90->sourcefile~atmcfg_m.f90 sourcefile~bd_solver_m.f90->sourcefile~stats_m.f90 sourcefile~bd_solver_m.f90->sourcefile~trajectory_m.f90 sourcefile~bd_solver_m.f90->sourcefile~interaction_m.f90 sourcefile~brown_m.f90 brown_m.f90 sourcefile~bd_solver_m.f90->sourcefile~brown_m.f90 sourcefile~trajectory_m.f90->sourcefile~constants_m.f90 sourcefile~random_m.f90->sourcefile~constants_m.f90 sourcefile~interaction_m.f90->sourcefile~control_m.f90 sourcefile~interaction_m.f90->sourcefile~constants_m.f90 sourcefile~interaction_m.f90->sourcefile~atmcfg_m.f90 sourcefile~interaction_m.f90->sourcefile~stats_m.f90 sourcefile~interaction_m.f90->sourcefile~simbox_m.f90 sourcefile~table_m.f90 table_m.f90 sourcefile~interaction_m.f90->sourcefile~table_m.f90 sourcefile~pairtab_m.fpp pairtab_m.fpp sourcefile~interaction_m.f90->sourcefile~pairtab_m.fpp sourcefile~ia_vdw_m.f90 ia_vdw_m.f90 sourcefile~interaction_m.f90->sourcefile~ia_vdw_m.f90 sourcefile~ia_dihedral_m.f90 ia_dihedral_m.f90 sourcefile~interaction_m.f90->sourcefile~ia_dihedral_m.f90 sourcefile~ia_external_m.f90 ia_external_m.f90 sourcefile~interaction_m.f90->sourcefile~ia_external_m.f90 sourcefile~ia_angle_m.f90 ia_angle_m.f90 sourcefile~interaction_m.f90->sourcefile~ia_angle_m.f90 sourcefile~ia_tether_m.f90 ia_tether_m.f90 sourcefile~interaction_m.f90->sourcefile~ia_tether_m.f90 sourcefile~ia_bond_m.f90 ia_bond_m.f90 sourcefile~interaction_m.f90->sourcefile~ia_bond_m.f90 sourcefile~simbox_m.f90->sourcefile~constants_m.f90 sourcefile~simbox_m.f90->sourcefile~random_m.f90 sourcefile~table_m.f90->sourcefile~constants_m.f90 sourcefile~vector_m.f90 vector_m.f90 sourcefile~table_m.f90->sourcefile~vector_m.f90 sourcefile~pairtab_m.fpp->sourcefile~constants_m.f90 sourcefile~pairtab_m.fpp->sourcefile~atmcfg_m.f90 sourcefile~pairtab_m.fpp->sourcefile~simbox_m.f90 sourcefile~pairtab_m.fpp->sourcefile~table_m.f90 sourcefile~cell_list_m.f90 cell_list_m.f90 sourcefile~pairtab_m.fpp->sourcefile~cell_list_m.f90 sourcefile~connectivity_m.f90 connectivity_m.f90 sourcefile~pairtab_m.fpp->sourcefile~connectivity_m.f90 sourcefile~aabbtree_m.f90 aabbtree_m.f90 sourcefile~pairtab_m.fpp->sourcefile~aabbtree_m.f90 sourcefile~pairtab_m.fpp->sourcefile~vector_m.f90 sourcefile~brown_m.f90->sourcefile~logger_m.f90 sourcefile~brown_m.f90->sourcefile~constants_m.f90 sourcefile~brown_m.f90->sourcefile~strings_m.f90 sourcefile~brown_m.f90->sourcefile~random_m.f90 sourcefile~ia_vdw_m.f90->sourcefile~constants_m.f90 sourcefile~ia_vdw_m.f90->sourcefile~atmcfg_m.f90 sourcefile~ia_dihedral_m.f90->sourcefile~constants_m.f90 sourcefile~ia_dihedral_m.f90->sourcefile~atmcfg_m.f90 sourcefile~ia_external_m.f90->sourcefile~constants_m.f90 sourcefile~ia_external_m.f90->sourcefile~atmcfg_m.f90 sourcefile~ia_angle_m.f90->sourcefile~constants_m.f90 sourcefile~ia_angle_m.f90->sourcefile~atmcfg_m.f90 sourcefile~ia_tether_m.f90->sourcefile~constants_m.f90 sourcefile~ia_tether_m.f90->sourcefile~atmcfg_m.f90 sourcefile~ia_bond_m.f90->sourcefile~logger_m.f90 sourcefile~ia_bond_m.f90->sourcefile~constants_m.f90 sourcefile~ia_bond_m.f90->sourcefile~strings_m.f90 sourcefile~cell_list_m.f90->sourcefile~constants_m.f90 sourcefile~cell_list_m.f90->sourcefile~simbox_m.f90 sourcefile~cell_list_m.f90->sourcefile~vector_m.f90 sourcefile~connectivity_m.f90->sourcefile~constants_m.f90 sourcefile~connectivity_m.f90->sourcefile~table_m.f90 sourcefile~connectivity_m.f90->sourcefile~vector_m.f90 sourcefile~aabbtree_m.f90->sourcefile~constants_m.f90 sourcefile~aabbtree_m.f90->sourcefile~strings_m.f90 sourcefile~aabbtree_m.f90->sourcefile~vector_m.f90 sourcefile~aabb_m.fpp aabb_m.fpp sourcefile~aabbtree_m.f90->sourcefile~aabb_m.fpp sourcefile~vector_m.f90->sourcefile~constants_m.f90 sourcefile~qsort_m.f90 qsort_m.f90 sourcefile~vector_m.f90->sourcefile~qsort_m.f90 sourcefile~aabb_m.fpp->sourcefile~constants_m.f90 sourcefile~aabb_m.fpp->sourcefile~strings_m.f90 sourcefile~qsort_m.f90->sourcefile~constants_m.f90

Contents

Source Code


Source Code

!********************************************************************************!
! The MIT License (MIT)                                                          !
!                                                                                !
! Copyright (c) 2020 Sarit Dutta <saridut@gmail.com>                             !
!                                                                                !
! Permission is hereby granted, free of charge, to any person obtaining a copy   !
! of this software and associated documentation files (the "Software"), to deal  !
! in the Software without restriction, including without limitation the rights   !
! to use, copy, modify, merge, publish, distribute, sublicense, and/or sell      !
! copies of the Software, and to permit persons to whom the Software is          !
! furnished to do so, subject to the following conditions:                       !
!                                                                                !
! The above copyright notice and this permission notice shall be included in all !
! copies or substantial portions of the Software.                                !
!                                                                                !
! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR     !
! IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,       !
! FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE    !
! AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER         !
! LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,  !
! OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE  !
! SOFTWARE.                                                                      !
!********************************************************************************!

program main

use constants_m
use strings_m
use logger_m
use control_m
use setup_m

implicit none

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

character(len=64) :: cla
character(len=:), allocatable :: key
character(len=:), allocatable :: val
character(len=:), allocatable :: job_tag
character(len=:), allocatable :: fn_control
type(ctrlpar_t) :: cpar
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
!
!Usage: ./brownpak fn_control=<str> job_tag=<int>

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 cpar%read(fn_control)

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

call run(cpar, job_tag)

call logger%finish()

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

end program