Commit 4ab04e9c authored by Daniel Wortmann's avatar Daniel Wortmann

Added code to enhance treatment of environment variable for command line options

parent 926ac62a
...@@ -5,16 +5,9 @@ ...@@ -5,16 +5,9 @@
!-------------------------------------------------------------------------------- !--------------------------------------------------------------------------------
MODULE m_juDFT_args MODULE m_juDFT_args
!This subroutine allows to query for command line arguments !This subroutine allows to query for command line arguments
!The following command line arguments are known to FLEUR PRIVATE
! eig66_io.F90: -da, -mem, -mpi, -hdf CHARACTER(len=5):: ENV_NAME="juDFT" !name of environment variable
! --> choose the storage of eigenvalues&vectors PUBLIC judft_was_argument,juDFT_string_for_argument
! 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 CONTAINS
FUNCTION juDFT_was_argument(arg) RESULT(OK) FUNCTION juDFT_was_argument(arg) RESULT(OK)
USE m_fleur_arguments USE m_fleur_arguments
...@@ -43,20 +36,30 @@ CONTAINS ...@@ -43,20 +36,30 @@ CONTAINS
END FUNCTION juDFT_was_argument END FUNCTION juDFT_was_argument
FUNCTION juDFT_string_for_argument(arg) RESULT(argstring) FUNCTION juDFT_string_for_argument(arg) RESULT(argstring)
IMPLICIT NONE IMPLICIT NONE
CHARACTER(len=*),INTENT(IN)::arg CHARACTER(len=*),INTENT(IN)::arg
CHARACTER(len=1000)::argstring CHARACTER(len=1000)::argstring
INTEGER:: i INTEGER:: i
CHARACTER(LEN=30)::str CHARACTER(LEN=30) ::str
CHARACTER(LEN=1000)::env
argstring="" argstring=""
DO i=1,COMMAND_ARGUMENT_COUNT() IF (judft_was_argument(arg)) THEN
CALL GET_COMMAND_ARGUMENT(i,str) DO i=1,COMMAND_ARGUMENT_COUNT()
IF(ADJUSTL(str)==ADJUSTL(arg)) THEN CALL GET_COMMAND_ARGUMENT(i,str)
if (i<=COMMAND_ARGUMENT_COUNT()) CALL GET_COMMAND_ARGUMENT(i+1,argstring) IF(ADJUSTL(str)==ADJUSTL(arg)) THEN
endif IF (i<=COMMAND_ARGUMENT_COUNT()) CALL GET_COMMAND_ARGUMENT(i+1,argstring)
ENDDO RETURN !Argument found
ENDIF
ENDDO
!Not found so must be in environment variable
CALL GET_ENVIRONMENT_VARIABLE("juDFT",env,status=i)
!cut of argument string
env=ADJUSTL(env(INDEX(env//' ',TRIM(ADJUSTL(arg)))+1:))//' '
i=INDEX(env,' ') !find first blank
argstring=TRIM(env(:i))
END IF
END FUNCTION juDFT_string_for_argument END FUNCTION juDFT_string_for_argument
END MODULE m_juDFT_args 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