TABLE OF CONTENTS
ABINIT/chkint_ge [ Functions ]
NAME
chkint_ge
FUNCTION
Checks the value of an input integer variable, expected to be greater than some value, and write a sophisticated error message when it is erroneous. A few conditions might have been checked before calling chkint_ge, and these are mentioned in the error message. See the examples in the NOTES
COPYRIGHT
Copyright (C) 1998-2017 ABINIT group (XG) This file is distributed under the terms of the GNU General Public License, see ~abinit/COPYING or http://www.gnu.org/copyleft/gpl.txt . For the initials of contributors, see ~abinit/doc/developers/contributors.txt .
INPUTS
advice_change_cond= if 1, and if an error is detected, will advice to change the value of the conditions. cond_number= number of conditions checked before calling chkint_ge. cond_string(cond_number)= name of the variables associated to the conditions. cond_values(cond_number)= value of the variables associated to the conditions. input_name=name of the input variable to be checked input_value=value of the input variable to be checked minmax_value=see the description of minmax_flag unit=unit number for clean output file
OUTPUT
(only side effect) SIDE EFFECT ierr= switch it to 1 if an error was detected. No action otherwise.
NOTES
cond_values(cond_number) or list_values(list_number) must be between -99 and 999 to be printed correctly. for the time being, at most 3 conditions are allowed.
PARENTS
chkinp,invars1
CHILDREN
chkint_prt
SOURCE
53 #if defined HAVE_CONFIG_H 54 #include "config.h" 55 #endif 56 57 #include "abi_common.h" 58 59 subroutine chkint_ge(advice_change_cond,cond_number,cond_string,cond_values,& 60 & ierr,input_name,input_value,minmax_value,unit) 61 62 use defs_basis 63 use m_profiling_abi 64 65 !This section has been created automatically by the script Abilint (TD). 66 !Do not modify the following lines by hand. 67 #undef ABI_FUNC 68 #define ABI_FUNC 'chkint_ge' 69 use interfaces_57_iovars, except_this_one => chkint_ge 70 !End of the abilint section 71 72 implicit none 73 74 !Arguments ------------------------------------ 75 !scalars 76 integer,intent(in) :: advice_change_cond,cond_number,input_value 77 integer,intent(in) :: minmax_value,unit 78 integer,intent(inout) :: ierr 79 character(len=*),intent(in) :: input_name 80 !arrays 81 integer,intent(in) :: cond_values(4) 82 character(len=*),intent(inout) :: cond_string(4) 83 84 !Local variables------------------------------- 85 !scalars 86 integer :: list_number,minmax_flag,ok 87 integer, allocatable :: list_values(:) 88 89 !****************************************************************** 90 91 !Checks the allowed values 92 ok=0 93 minmax_flag=1 94 if(input_value>=minmax_value)ok=1 95 list_number=1 96 ABI_ALLOCATE(list_values,(1)) 97 list_values=minmax_value 98 99 !If there is something wrong, compose the message, and print it 100 if(ok==0)then 101 call chkint_prt(advice_change_cond,cond_number,cond_string,cond_values,& 102 & ierr,input_name,input_value,& 103 & list_number,list_values,minmax_flag,minmax_value,unit) 104 end if 105 106 ABI_DEALLOCATE(list_values) 107 108 ! reset all cond_strings 109 cond_string(:)='#####' 110 111 end subroutine chkint_ge