Commit cc954abd authored by Daniel Wortmann's avatar Daniel Wortmann

Put argument handling into seperate module

parent 15a23533
!--------------------------------------------------------------------------------
! Copyright (c) 2016 Peter Grnberg Institut, Forschungszentrum Jlich, Germany
! This file is part of FLEUR and available as free software under the conditions
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------
MODULE m_juDFT_args
!This subroutine allows to query for command line arguments
!The following command line arguments are known to FLEUR
! eig66_io.F90: -da, -mem, -mpi, -hdf
! --> choose the storage of eigenvalues&vectors
! eigen_diag.F90: -lapack, -lapack2, -elpa, -magma, -scalapack
! --> choose diagonalization sheme
! time.F90: -debugtime --> write out the start/stop of all timers to STDOUT
! fleur_init.F90,set_inp.F90: --xmlInput
! --> choose xmlInput format
PUBLIC
CONTAINS
FUNCTION juDFT_was_argument(arg) RESULT(OK)
IMPLICIT NONE
CHARACTER(len=*),INTENT(IN)::arg
LOGICAL ok
INTEGER:: i
CHARACTER(LEN=30)::str
ok=.FALSE.
DO i=1,COMMAND_ARGUMENT_COUNT()
CALL GET_COMMAND_ARGUMENT(i,str)
IF(ADJUSTL(str)==ADJUSTL(arg)) ok=.TRUE.
ENDDO
IF (ok) RETURN
!Test for environment variable as well
CALL GET_ENVIRONMENT_VARIABLE("juDFT",str,status=i)
IF (i==0) ok=INDEX(str,ADJUSTL(arg))>0
END FUNCTION juDFT_was_argument
END MODULE m_juDFT_args
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment