Commit 6c7e08f9 authored by Daniel Wortmann's avatar Daniel Wortmann

Finished implementation of new command line argument handling

parent a92217bc
......@@ -82,7 +82,7 @@ CONTAINS
ENDDO
END IF
! -----is region
IF (.not.judft_was_Argument("-oldfix")) THEN
IF (.FALSE.) THEN !Change this for old way of determination of int-charge
CALL convol(stars,x,den%pw(:,jspin),stars%ufft)
qis = x(1)*cell%omtil
ELSE
......
......@@ -57,7 +57,8 @@ kpoints/tetcon.f kpoints/kvecon.f init/boxdim.f math/ylm4.f global/radsra.f math
set(inpgen_F90 ${inpgen_F90} global/constants.f90 io/xsf_io.f90
eigen/vec_for_lo.f90 eigen/orthoglo.F90 juDFT/usage_data.F90
global/enpara.f90 global/chkmt.f90 inpgen/inpgen.f90 inpgen/set_inp.f90 inpgen/inpgen_help.f90 io/rw_inp.f90 juDFT/juDFT.F90 global/find_enpara.f90 inpgen/closure.f90
global/enpara.f90 global/chkmt.f90 inpgen/inpgen.f90 inpgen/set_inp.f90 inpgen/inpgen_help.f90 io/rw_inp.f90 juDFT/juDFT.F90 global/find_enpara.f90
inpgen/closure.f90 inpgen/inpgen_arguments.F90
juDFT/info.F90 juDFT/stop.F90 juDFT/args.F90 juDFT/time.F90 juDFT/init.F90 juDFT/sysinfo.F90 io/w_inpXML.f90 kpoints/julia.f90 global/utility.F90
init/compile_descr.F90 kpoints/kpoints.f90 io/xmlOutput.F90 kpoints/brzone2.f90 cdn/slab_dim.f90 cdn/slabgeom.f90 dos/nstm3.f90 cdn/int_21.f90
cdn/int_21lo.f90 cdn_mt/rhomt21.f90 cdn_mt/rhonmt21.f90 force/force_a21.F90 force/force_a21_lo.f90 force/force_a21_U.f90 force/force_a12.f90
......
......@@ -109,12 +109,12 @@ CONTAINS
scale_distance=1E-3
IF (judft_was_argument("-chase_scale")) THEN
arg=juDFT_string_for_argument("-chase_scale")
READ(arg,*) scale_distance
ENDIF
!IF (judft_was_argument("-chase_tol_scale")) THEN
! arg=juDFT_string_for_argument("-chase_tol_scale")
! READ(arg,*) scale_distance
!ENDIF
IF (juDFT_was_argument("-diag:chase")) THEN
IF (TRIM(juDFT_string_for_argument("-diag"))=="chase") THEN
nevd = min(dimension%neigd,dimension%nvd+atoms%nlotot)
nexd = min(max(nevd/4, 45),dimension%nvd+atoms%nlotot-nevd) !dimensioning for workspace
chase_eig_id=open_eig(mpi%mpi_comm,DIMENSION%nbasfcn,nevd+nexd,kpts%nkpt,DIMENSION%jspd,&
......
......@@ -65,7 +65,7 @@ CONTAINS
LOGICAL :: parallel
!For check-mode
TYPE(t_mat) :: s_store,h_store
SELECT TYPE(smat)
CLASS IS (t_mpimat)
......@@ -75,7 +75,7 @@ CONTAINS
END SELECT
!Create a copy of the matrix if in test mode
IF (judft_was_argument("-diag:test")) THEN
IF (TRIM(judft_string_for_argument("-diag"))=="test") THEN
SELECT TYPE(hmat)
CLASS IS (t_mpimat)
CALL s_store%init(hmat%l_real,hmat%global_size1,hmat%global_size2)
......@@ -112,7 +112,7 @@ CONTAINS
END SELECT
!Create test the solution
IF (judft_was_argument("-diag:test")) THEN
IF (TRIM(judft_string_for_argument("-diag"))=="test") THEN
CALL priv_test_solution(mpi,ne,s_store,h_store,eig,ev)
CALL judft_error("Diagonalization tested")
END IF
......@@ -223,13 +223,13 @@ CONTAINS
ENDIF
!check if a special solver was requested
IF (juDFT_was_argument("-diag:elpa")) diag_solver=diag_elpa
IF (juDFT_was_argument("-diag:scalapack")) diag_solver=diag_scalapack
IF (juDFT_was_argument("-diag:elemental")) diag_solver=diag_elemental
IF (juDFT_was_argument("-diag:lapack")) diag_solver=diag_lapack
IF (juDFT_was_argument("-diag:magma")) diag_solver=diag_magma
IF (juDFT_was_argument("-diag:chase")) diag_solver=diag_chase
IF (juDFT_was_argument("-diag:debugout")) diag_solver=diag_debugout
IF (TRIM(juDFT_string_for_argument("-diag"))=="elpa") diag_solver=diag_elpa
IF (trim(juDFT_string_for_argument("-diag"))=="scalapack") diag_solver=diag_scalapack
IF (trim(juDFT_string_for_argument("-diag"))=="elemental") diag_solver=diag_elemental
IF (trim(juDFT_string_for_argument("-diag"))=="lapack") diag_solver=diag_lapack
IF (trim(juDFT_string_for_argument("-diag"))=="magma") diag_solver=diag_magma
IF (trim(juDFT_string_for_argument("-diag"))=="chase") diag_solver=diag_chase
IF (trim(juDFT_string_for_argument("-diag"))=="debugout") diag_solver=diag_debugout
!Check if solver is possible
if (diag_solver<0) call priv_solver_error(diag_solver,parallel)
......
set(fleur_F77 ${fleur_F77}
global/differ.f
global/fitchk.f
global/nmat_rot.f
global/od_cylbes.f
......@@ -19,6 +18,7 @@ global/savewigner.f
)
set(fleur_F90 ${fleur_F90}
global/constants.f90
global/differ.f90
global/matrix_copy.F90
global/checkdop.F90
global/checkdopall.f90
......
......@@ -14,7 +14,7 @@ MODULE m_checks
INCLUDE 'mpif.h'
INTEGER:: isize,ierr,irank
#endif
IF (juDFT_was_argument("-hdf")) THEN
IF (TRIM(juDFT_string_for_argument("-eig"))=="hdf") THEN
#ifndef CPP_HDF
CALL judft_error("HDF5 cannot be used for Eigenvector IO",&
hint="You compiled without support for HDF5. Please use another mode")
......@@ -31,10 +31,10 @@ MODULE m_checks
CALL MPI_COMM_SIZE(MPI_COMM_WORLD,irank,ierr)
IF (irank.EQ.0) THEN
IF (isize>1) THEN
IF (juDFT_was_argument("-mem")) CALL judft_error(&
"-mem cannot be used in parallel mode for Eigenvector IO",hint="Use -mpi or -hdf instead")
IF (juDFT_was_argument("-da")) CALL judft_error(&
"-da cannot be used in parallel mode for Eigenvector IO",hint="Use -mpi or -hdf instead")
IF (TRIM(juDFT_string_for_argument("-eig"))=="-mem") CALL judft_error(&
"-eig mem cannot be used in parallel mode for Eigenvector IO",hint="Use -eig mpi or -eig hdf instead")
IF (TRIM(juDFT_string_for_argument("-eig"))=="-da") CALL judft_error(&
"-eig da cannot be used in parallel mode for Eigenvector IO",hint="Use -eig mpi or -eig hdf instead")
END IF
END IF
#endif
......
!--------------------------------------------------------------------------------
! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, 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_fleur_arguments
IMPLICIT NONE
PRIVATE
TYPE t_fleur_param
INTEGER :: TYPE !can be 0,1,2 for a simple argument, an argument with a string or with a number
CHARACTER(len=20) :: name
CHARACTER(len=200) :: desc
CHARACTER(len=200) :: values
END TYPE t_fleur_param
INTEGER,PARAMETER:: no_params=5
TYPE(t_fleur_param) :: fleur_param(no_params)=(/&
t_fleur_param(0,"-old","Generate input file for old fleur versions",""),&
t_fleur_param(0,"-explicit","write out k-point list, symmetry operations, and optional input to inp.xml",""),&
t_fleur_param(0,"-electronConfig","explicitely write the electron configuration into inp.xml",""),&
t_fleur_param(0,"-fast_defaults","generate more aggressive (and less stable) input parameters for faster calculations",""),&
t_fleur_param(0,"-h","print this help message","")&
/)
PUBLIC argument_type,print_argument,check_arguments
CONTAINS
FUNCTION argument_type(name)
IMPLICIT NONE
CHARACTER(len=*),INTENT(in):: name
INTEGER :: n,argument_type
argument_type=-1
DO n=1,SIZE(fleur_param)
IF (TRIM(name)==fleur_param(n)%name) argument_type=fleur_param(n)%TYPE
END DO
END FUNCTION argument_type
LOGICAL FUNCTION check_arguments()
IMPLICIT NONE
INTEGER :: i,n
CHARACTER(len=200):: str
check_arguments=.TRUE.
i=1
DO WHILE(i<=COMMAND_ARGUMENT_COUNT())
CALL GET_COMMAND_ARGUMENT(i,str)
param_loop:DO n=1,SIZE(fleur_param)
IF (TRIM(str)==fleur_param(n)%name) THEN
SELECT CASE (fleur_param(n)%TYPE)
CASE(1)
i=i+1
CALL GET_COMMAND_ARGUMENT(i,str)
IF (TRIM(fleur_param(n)%values)/="") THEN
IF (INDEX(TRIM(fleur_param(n)%values),TRIM(str))==0) THEN
PRINT *,"Invalid value :",TRIM(str)
PRINT *,"Possible values:",TRIM(fleur_param(n)%values)
check_arguments=.false.
END IF
END IF
CASE(2)
i=i+1
END SELECT
EXIT param_loop
END IF
ENDDO param_loop
IF (n>SIZE(fleur_param)) THEN
PRINT *,"Unkown command line argument:"//str
check_arguments=.FALSE.
END IF
i=i+1
ENDDO
END FUNCTION check_arguments
SUBROUTINE print_argument(name)
IMPLICIT NONE
CHARACTER(len=*),INTENT(in):: name
INTEGER :: n
DO n=1,no_params
IF (TRIM(name)==TRIM(fleur_param(n)%name)) THEN
IF (fleur_param(n)%TYPE==0) THEN !parameter without option
WRITE(*,1001) TRIM(fleur_param(n)%name),TRIM(fleur_param(n)%desc)
ELSEIF (fleur_param(n)%TYPE==1) THEN
IF (fleur_param(n)%values=="") THEN !parameter with string
WRITE(*,1002) TRIM(fleur_param(n)%name),TRIM(fleur_param(n)%desc)
ELSE !parameter with string and choice
WRITE(*,1003) TRIM(fleur_param(n)%name),TRIM(fleur_param(n)%values),TRIM(fleur_param(n)%desc)
END IF
ELSE !parameter with number
WRITE(*,1004) TRIM(fleur_param(n)%name),TRIM(fleur_param(n)%desc)
ENDIF
RETURN
ENDIF
END DO
1001 FORMAT(t5,a,t20,": ",a)
1002 FORMAT(t5,a," $$$",t20,": ",a)
1003 FORMAT(t5,a," [",a,"]",/,t20,": ",a)
1004 FORMAT(t5,a," #",t20,": ",a)
PRINT *,"BUG IN FLEUR, check handling of parameters in fleur_help.f90"
PRINT *,name
END SUBROUTINE print_argument
END MODULE m_fleur_arguments
......@@ -10,6 +10,7 @@ CONTAINS
USE m_compile_descr
USE m_constants
USE m_juDFT
USE m_fleur_arguments
IMPLICIT NONE
CHARACTER(LEN=500):: infostring
......@@ -26,16 +27,12 @@ CONTAINS
WRITE(*,'(a)')"inpgen usage info:"
WRITE(*,'(a)')"The following command line options are known:"
WRITE(*,'(a)')""
WRITE(*,'(a)')"-old : generate input files for old fleur versions"
WRITE(*,'(a)')"-genEnpara : write enpara file"
WRITE(*,'(a)')"-explicit : write out k-point list, symmetry operations,"
WRITE(*,'(a)')" and optional input to inp.xml"
WRITE(*,'(a)')"-electronConfig : explicitely write the electron configuration into inp.xml"
WRITE(*,'(a)')"-fast_defaults : generate more aggressive (and less stable)"
WRITE(*,'(a)')" input parameters for faster calculations"
WRITE(*,'(a)')""
WRITE(*,'(a)')"-h, --help : print this text :-)"
WRITE(*,'(a)')""
CALL print_argument("-old")
CALL print_argument("-genEnpara")
CALL print_argument("-explicit")
CALL print_argument("-electronConfig")
CALL print_argument("-fast_defaults")
CALL print_argument("-h")
WRITE(*,'(a)')""
WRITE(*,'(a)')"Please check the documentation on www.flapw.de for more details"
......
......@@ -1384,9 +1384,9 @@ MODULE m_cdn_io
INTEGER, INTENT(OUT) :: mode
mode = CDN_DIRECT_MODE
IF (juDFT_was_argument("-stream_cdn")) THEN
mode=CDN_STREAM_MODE
END IF
!IF (juDFT_was_argument("-stream_cdn")) THEN
! mode=CDN_STREAM_MODE
!END IF
IF (.NOT.juDFT_was_argument("-no_cdn_hdf")) THEN !juDFT_was_argument("-hdf_cdn")) THEN
#ifdef CPP_HDF
mode=CDN_HDF5_MODE
......
......@@ -46,10 +46,10 @@ CONTAINS
mode=MEM_mode
#endif
!check if default was given on command-line
IF (juDFT_was_argument("-mpi")) mode=MPI_mode
IF (juDFT_was_argument("-mem")) mode=MEM_mode
IF (juDFT_was_argument("-da")) mode=DA_mode
IF (juDFT_was_argument("-hdf")) mode=HDF_mode
IF (TRIM(juDFT_string_for_argument("-eig"))=="mpi") mode=MPI_mode
IF (TRIM(juDFT_string_for_argument("-eig"))=="mem") mode=MEM_mode
IF (TRIM(juDFT_string_for_argument("-eig"))=="da") mode=DA_mode
IF (TRIM(juDFT_string_for_argument("-eig"))=="hdf") mode=HDF_mode
ENDIF
!Check if mode is available
#ifndef CPP_MPI
......
......@@ -268,7 +268,7 @@ MODULE m_pot_io
INTEGER, INTENT(OUT) :: mode
mode = POT_DIRECT_MODE
IF (juDFT_was_argument("-stream_cdn")) mode=POT_STREAM_MODE
!IF (juDFT_was_argument("-stream_cdn")) mode=POT_STREAM_MODE
IF (.NOT.juDFT_was_argument("-no_cdn_hdf")) THEN !juDFT_was_argument("-hdf_cdn")) THEN
#ifdef CPP_HDF
mode=POT_HDF5_MODE
......
......@@ -122,7 +122,7 @@ SUBROUTINE w_inpXML(&
IF (PRESENT(name_opt)) name=name_opt
l_explicit = l_explicitIn.OR.l_outFile
l_nocoOpt = noco%l_noco.OR.juDFT_was_argument("-noco")
l_nocoOpt = noco%l_noco!.OR.juDFT_was_argument("-noco")
symFilename = 'sym.out'
kptGamma = l_gamma
......
......@@ -140,12 +140,7 @@ SUBROUTINE xmlValidateDoc()
errorStatus = 0
errorStatus = validateXMLDocument()
IF(errorStatus.NE.0) THEN
IF (judft_was_argument("-noXMLvalidate")) THEN
PRINT *,"WARNING, inp.xml did not validate, but you decided to try anyway..."
PRINT *,"You will get what you deserve!"
ELSE
CALL juDFT_error("XML document cannot be validated against Schema.",calledby="xmlValidateDoc")
END IF
CALL juDFT_error("XML document cannot be validated against Schema.",calledby="xmlValidateDoc")
END IF
END SUBROUTINE xmlValidateDoc
......
......@@ -17,12 +17,20 @@ MODULE m_juDFT_args
PUBLIC
CONTAINS
FUNCTION juDFT_was_argument(arg) RESULT(OK)
USE m_fleur_arguments
IMPLICIT NONE
CHARACTER(len=*),INTENT(IN)::arg
LOGICAL ok
INTEGER:: i
CHARACTER(LEN=30)::str
!check if argument is allowed
IF (argument_type(arg)<0) THEN
PRINT *,"Argument query invalid:",arg
PRINT *,"Add specification for fleur_arguments"
STOP "BUG in FLEUR, invalid argument query"
END IF
ok=.FALSE.
DO i=1,COMMAND_ARGUMENT_COUNT()
CALL GET_COMMAND_ARGUMENT(i,str)
......
set(fleur_F77 ${fleur_F77}
)
)
set(fleur_F90 ${fleur_F90}
main/cdngen.F90
main/fleur.F90
main/fleur_init.F90
main/fleur_job.F90
main/fleur_help.F90
main/fleur_arguments.F90
main/fleur_info.f90
main/mix.F90
main/optional.F90
......
!--------------------------------------------------------------------------------
! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, 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_fleur_arguments
IMPLICIT NONE
PRIVATE
TYPE t_fleur_param
INTEGER :: TYPE !can be 0,1,2 for a simple argument, an argument with a string or with a number
CHARACTER(len=20) :: name
CHARACTER(len=200) :: desc
CHARACTER(len=200) :: values
END TYPE t_fleur_param
#ifdef CPP_HDF
INTEGER,PARAMETER:: no_params=21
#else
INTEGER,PARAMETER:: no_params=17
#endif
TYPE(t_fleur_param) :: fleur_param(no_params)=(/&
!Input options
t_fleur_param(0,"-toXML","Convert an old 'inp' file into the new XML format",""),&
t_fleur_param(1,"-xmlXpath","modify the xml-xpath of the inp.xml file",""),&
!Control the job
t_fleur_param(0,"-check","run in check mode, i.e. stop after init",""),&
t_fleur_param(0,"-info","Print out information on recommended parallelization and available charge densities",""),&
t_fleur_param(2,"-wtime","run for # minutes (used to estimate if another iteration is started)",""),&
t_fleur_param(1,"-j","Distribute MPI ranks to run subjobs (Format PE:DIR meaning run with PE in directory DIR)",""),&
t_fleur_param(1,"-f","Obtain info on subjobs from file",""),&
t_fleur_param(2,"-n_min_size","Try to use at least specified number of PE in eigenvalue parallelization",""),&
t_fleur_param(1,"-diag","Choose method for diagonalization","lapack,debugout"&
#ifdef CPP_SCALAPACK
//",scalapack"&
#endif
#ifdef CPP_ELPA
//",elpa"&
#endif
#ifdef CPP_CHASE
//",chase"&
#endif
#ifdef CPP_MAGMA
//",magma"&
#endif
),&
t_fleur_param(1,"-eig","Method for storing the eigenvectors","mem,da"&
#ifdef CPP_MPI
//",mpi"&
#endif
#ifdef CPP_HDF
//",hdf"&
#endif
),&
!Debugging
t_fleur_param(0,"-warn_only","Continue execution after a warning message",""),&
t_fleur_param(0,"-trace","Try to generate a stacktrace in case of an error",""),&
t_fleur_param(0,"-debugtime","Write the start/stop of all timers to the console",""),&
!Output
t_fleur_param(0,"-no_out","Do not open the 'out' file but write to stdout",""),&
t_fleur_param(0,"-gen_enpara","Generate an 'enpara' file for the energy parameters",""),&
t_fleur_param(0,"-h","Print this message",""),&
t_fleur_param(0,"-no_send","Do not send usage data","")&
!HDF density
#ifdef CPP_HDF
,t_fleur_param(0,"-no_cdn_hdf","Disable HDF charge density mode (activated by default if HDF5 is available)","")&
,t_fleur_param(0,"-last_extra","Generate an additional file cdn_last.hdf that contains only the last density","")&
,t_fleur_param(2,"-sd","use starting density N, where N is the index of the density according to -info","")&
,t_fleur_param(1,"-delden","delete densities (either an index N, a range N-M or the keyword 'allbutlast' should be given)","")&
#endif
/)
PUBLIC argument_type,print_argument,check_arguments
CONTAINS
FUNCTION argument_type(name)
IMPLICIT NONE
CHARACTER(len=*),INTENT(in):: name
INTEGER :: n,argument_type
argument_type=-1
DO n=1,SIZE(fleur_param)
IF (TRIM(name)==fleur_param(n)%name) argument_type=fleur_param(n)%TYPE
END DO
END FUNCTION argument_type
LOGICAL FUNCTION check_arguments()
IMPLICIT NONE
INTEGER :: i,n
CHARACTER(len=200):: str
check_arguments=.TRUE.
i=1
DO WHILE(i<=COMMAND_ARGUMENT_COUNT())
CALL GET_COMMAND_ARGUMENT(i,str)
param_loop:DO n=1,SIZE(fleur_param)
IF (TRIM(str)==fleur_param(n)%name) THEN
SELECT CASE (fleur_param(n)%TYPE)
CASE(1)
i=i+1
CALL GET_COMMAND_ARGUMENT(i,str)
IF (TRIM(fleur_param(n)%values)/="") THEN
IF (INDEX(TRIM(fleur_param(n)%values),TRIM(str))==0) THEN
PRINT *,"Invalid value :",TRIM(str)
PRINT *,"Possible values:",TRIM(fleur_param(n)%values)
check_arguments=.false.
END IF
END IF
CASE(2)
i=i+1
END SELECT
EXIT param_loop
END IF
ENDDO param_loop
IF (n>SIZE(fleur_param)) THEN
PRINT *,"Unkown command line argument:"//str
check_arguments=.FALSE.
END IF
i=i+1
ENDDO
END FUNCTION check_arguments
SUBROUTINE print_argument(name)
IMPLICIT NONE
CHARACTER(len=*),INTENT(in):: name
INTEGER :: n
DO n=1,no_params
IF (TRIM(name)==TRIM(fleur_param(n)%name)) THEN
IF (fleur_param(n)%TYPE==0) THEN !parameter without option
WRITE(*,1001) TRIM(fleur_param(n)%name),TRIM(fleur_param(n)%desc)
ELSEIF (fleur_param(n)%TYPE==1) THEN
IF (fleur_param(n)%values=="") THEN !parameter with string
WRITE(*,1002) TRIM(fleur_param(n)%name),TRIM(fleur_param(n)%desc)
ELSE !parameter with string and choice
WRITE(*,1003) TRIM(fleur_param(n)%name),TRIM(fleur_param(n)%values),TRIM(fleur_param(n)%desc)
END IF
ELSE !parameter with number
WRITE(*,1004) TRIM(fleur_param(n)%name),TRIM(fleur_param(n)%desc)
ENDIF
RETURN
ENDIF
END DO
1001 FORMAT(t5,a,t20,": ",a)
1002 FORMAT(t5,a," $$$",t20,": ",a)
1003 FORMAT(t5,a," [",a,"]",/,t20,": ",a)
1004 FORMAT(t5,a," #",t20,": ",a)
PRINT *,"BUG IN FLEUR, check handling of parameters in fleur_help.f90"
PRINT *,name
END SUBROUTINE print_argument
END MODULE m_fleur_arguments
......@@ -5,149 +5,24 @@
!--------------------------------------------------------------------------------
MODULE m_fleur_help
IMPLICIT NONE
PRIVATE
TYPE t_fleur_param
INTEGER :: TYPE
CHARACTER(len=20) :: name
CHARACTER(len=200) :: desc
CHARACTER(len=200) :: values
END TYPE t_fleur_param
#ifdef CPP_HDF
INTEGER,PARAMETER:: no_params=20
#else
INTEGER,PARAMETER:: no_params=16
#endif
TYPE(t_fleur_param) :: fleur_param(no_params)=(/&
!Input options
t_fleur_param(0,"-toXML","Convert an old 'inp' file into the new XML format",""),&
t_fleur_param(1,"-xmlXpath","modify the xml-xpath of the inp.xml file",""),&
!Control the job
t_fleur_param(0,"-check","run in check mode, i.e. stop after init",""),&
t_fleur_param(0,"-info","Print out information on recommended parallelization and available charge densities",""),&
t_fleur_param(2,"-wtime","run for # minutes (used to estimate if another iteration is started)",""),&
t_fleur_param(1,"-j","Distribute MPI ranks to run subjobs (Format PE:DIR meaning run with PE in directory DIR)",""),&
t_fleur_param(1,"-f","Obtain info on subjobs from file",""),&
t_fleur_param(2,"-n_min_size","Try to use at least specified number of PE in eigenvalue parallelization",""),&
t_fleur_param(1,"-diag","Choose method for diagonalization","lapack,debugout"&
#ifdef CPP_SCALAPACK
//",scalapack"&
#endif
#ifdef CPP_ELPA
//",elpa"&
#endif
#ifdef CPP_CHASE
//",chase"&
#endif
#ifdef CPP_MAGMA
//",magma"&
#endif
),&
t_fleur_param(1,"-eig","Method for storing the eigenvectors","mem,da"&
#ifdef CPP_MPI
//",mpi"&
#endif
#ifdef CPP_HDF
//",hdf"&
#endif
),&
!Debugging
t_fleur_param(0,"-warn_only","Continue execution after a warning message",""),&
t_fleur_param(0,"-trace","Try to generate a stacktrace in case of an error",""),&
t_fleur_param(0,"-debugtime","Write the start/stop of all timers to the console",""),&
!Output
t_fleur_param(0,"-no_out","Do not open the 'out' file but write to stdout",""),&
t_fleur_param(0,"-gen_enpara","Generate an 'enpara' file for the energy parameters",""),&
t_fleur_param(0,"-h","Print this message","")&
!HDF density
#ifdef CPP_HDF
,t_fleur_param(0,"-no_cdn_hdf","Disable HDF charge density mode (activated by default if HDF5 is available)","")&
,t_fleur_param(0,"-last_extra","Generate an additional file cdn_last.hdf that contains only the last density","")&
,t_fleur_param(2,"-sd","use starting density N, where N is the index of the density according to -info","")&
,t_fleur_param(1,"-delden","delete densities (either an index N, a range N-M or the keyword 'allbutlast' should be given)","")&
#endif
/)
PUBLIC fleur_help
CONTAINS
SUBROUTINE check_arguments()
USE m_judft_stop
IMPLICIT NONE
INTEGER :: i,n
CHARACTER(len=200):: str
i=1
DO WHILE(i<=COMMAND_ARGUMENT_COUNT())
CALL GET_COMMAND_ARGUMENT(i,str)
param_loop:DO n=1,SIZE(fleur_param)
IF (TRIM(str)==fleur_param(n)%name) THEN
SELECT CASE (fleur_param(n)%TYPE)
CASE(1)
i=i+1
CALL GET_COMMAND_ARGUMENT(i,str)
IF (TRIM(fleur_param(n)%values)/="") THEN
IF (INDEX(TRIM(fleur_param(n)%values),TRIM(str))==0) THEN
PRINT *,"Invalid value :",TRIM(str)
PRINT *,"Possible values:",TRIM(fleur_param(n)%values)
CALL judft_warn("Invalid value to command line argument")
END IF
END IF
CASE(2)
i=i+1
END SELECT
EXIT param_loop
END IF
ENDDO param_loop
IF (n>SIZE(fleur_param)) CALL judft_warn("Unkown command line argument:"//str)
i=i+1
ENDDO
END SUBROUTINE check_arguments
SUBROUTINE print_param(name)
IMPLICIT NONE
CHARACTER(len=*),INTENT(in):: name
INTEGER :: n
DO n=1,no_params
IF (TRIM(name)==TRIM(fleur_param(n)%name)) THEN
IF (fleur_param(n)%TYPE==0) THEN !parameter without option
WRITE(*,1001) TRIM(fleur_param(n)%name),TRIM(fleur_param(n)%desc)
ELSEIF (fleur_param(n)%TYPE==1) THEN
IF (fleur_param(n)%values=="") THEN !parameter with string
WRITE(*,1002) TRIM(fleur_param(n)%name),TRIM(fleur_param(n)%desc)
ELSE !parameter with string and choice
WRITE(*,1003) TRIM(fleur_param(n)%name),TRIM(fleur_param(n)%values),TRIM(fleur_param(n)%desc)
END IF
ELSE !parameter with number
WRITE(*,1004) TRIM(fleur_param(n)%name),TRIM(fleur_param(n)%desc)
ENDIF
RETURN
ENDIF
END DO
1001 FORMAT(t5,a,t20,": ",a)
1002 FORMAT(t5,a," $$$",t20,": ",a)
1003 FORMAT(t5,a," [",a,"]",/,t20,": ",a)
1004 FORMAT(t5,a," #",t20,": ",a)
PRINT *,"BUG IN FLEUR, check handling of parameters in fleur_help.f90"
PRINT *,name
END SUBROUTINE print_param
SUBROUTINE fleur_help()
USE m_compile_descr
USE m_constants
USE m_juDFT
USE m_fleur_arguments
IMPLICIT NONE
CHARACTER(LEN=500):: infostring
PRINT *," Welcome to FLEUR (www.flapw.de) "
PRINT *," MaX-Release 2.1 (www.max-centre.eu)"
CALL check_arguments()
IF (.NOT.check_arguments()) CALL judft_warn("Invalid command line arguments",hint="Use -h option to see valid choices")
IF (.NOT. (juDFT_was_argument("-h").OR.juDFT_was_argument("--help"))) RETURN
IF (.NOT. judft_was_argument("-h")) RETURN
!now print version info and help on command line arguments:
CALL get_compile_desc_string(infostring)
......@@ -158,36 +33,36 @@ CONTAINS
WRITE(*,'(a)')"The following command line options are known:"
WRITE(*,'(a)')""
WRITE(*,'(a)')"Control the input:"
CALL print_param("-toXML")
CALL print_param("-xmlXpath")
CALL print_argument("-toXML")
CALL print_argument("-xmlXpath")
WRITE(*,'(a)')""
WRITE(*,'(a)')"Output options:"
CALL print_param("-no_out")
CALL print_param("-gen_enpara")
CALL print_param("-h")
CALL print_argument("-no_out")
CALL print_argument("-gen_enpara")
CALL print_argument("-h")
WRITE(*,'(a)')""
WRITE(*,'(a)')"Control FLEUR job:"
CALL print_param("-check")
CALL print_param("-info")
CALL print_param("-wtime")
CALL print_param("-j")
CALL print_param("-f")
CALL