1
!{\src2tex{textfont=tt}}
2
!!****f* ABINIT/int2char4
7
!! Convert an integer number to ("2") a character(len=4)
8
!! Makes sure that the integer is between 0 and 9999
11
!! Copyright (C) 2002-2007 ABINIT group (XG).
12
!! This file is distributed under the terms of the
13
!! GNU General Public License, see ~abinit/COPYING
14
!! or http://www.gnu.org/copyleft/gpl.txt .
15
!! For the initials of contributors, see ~abinit/doc/developers/contributors.txt .
18
!! iint=integer to be converted
21
!! string=character string
26
!! anascr,contract_int_list,gstate,iofn1,optic,read_wfrspa,respfn,scfcv
27
!! scfcv3,symgamma,tddft,tetrahedron
34
#if defined HAVE_CONFIG_H
38
subroutine int2char4(iint,string)
42
!This section has been created automatically by the script Abilint (TD). Do not modify these by hand.
43
#ifdef HAVE_FORTRAN_INTERFACES
44
use interfaces_01manage_mpi
46
!End of the abilint section
50
!Arguments ------------------------------------
52
integer,intent(in) :: iint
53
character(len=4),intent(out) :: string
55
!Local variables-------------------------------
57
character(len=500) :: message
59
! *************************************************************************
61
if(iint<0 .or. iint>9999)then
62
write(message, '(a,a,a,a,a,a,i10)' ) ch10,&
63
& ' int2char4: ERROR -',ch10,&
64
& ' The integer argument should be between 0 and 9999, while',ch10,&
66
call wrtout(6,message,'COLL')
67
call leave_new('COLL')
70
write(string,'("000",i1)')iint
72
write(string,'("00",i2)')iint
73
else if(iint<1000)then
74
write(string,'("0",i3)')iint
76
write(string,'(i4)')iint
79
end subroutine int2char4