~ubuntu-branches/debian/stretch/abinit/stretch

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
!{\src2tex{textfont=tt}}
!!****f* ABINIT/int2char4
!! NAME
!! int2char4
!!
!! FUNCTION
!! Convert an integer number to ("2") a character(len=4)
!! Makes sure that the integer is between 0 and 9999
!!
!! COPYRIGHT
!! Copyright (C) 2002-2007 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
!!  iint=integer to be converted
!!
!! OUTPUT
!!  string=character string
!!
!! SIDE EFFECTS
!!
!! PARENTS
!!      anascr,contract_int_list,gstate,iofn1,optic,read_wfrspa,respfn,scfcv
!!      scfcv3,symgamma,tddft,tetrahedron
!!
!! CHILDREN
!!      leave_new,wrtout
!!
!! SOURCE

#if defined HAVE_CONFIG_H
#include "config.h"
#endif

subroutine int2char4(iint,string)

 use defs_basis

!This section has been created automatically by the script Abilint (TD). Do not modify these by hand.
#ifdef HAVE_FORTRAN_INTERFACES
 use interfaces_01manage_mpi
#endif
!End of the abilint section

 implicit none

!Arguments ------------------------------------
!scalars
 integer,intent(in) :: iint
 character(len=4),intent(out) :: string

!Local variables-------------------------------
!scalars
 character(len=500) :: message

! *************************************************************************

 if(iint<0 .or. iint>9999)then
  write(message, '(a,a,a,a,a,a,i10)' ) ch10,&
&  ' int2char4: ERROR -',ch10,&
&  '  The integer argument should be between 0 and 9999, while',ch10,&
&  '  it is ',iint
    call wrtout(6,message,'COLL')
    call leave_new('COLL')
 end if
 if(iint<10)then
  write(string,'("000",i1)')iint
 else if(iint<100)then
  write(string,'("00",i2)')iint
 else if(iint<1000)then
  write(string,'("0",i3)')iint
 else
  write(string,'(i4)')iint
 end if

end subroutine int2char4
!!***