TABLE OF CONTENTS


ABINIT/inreplsp [ Functions ]

[ Top ] [ Functions ]

NAME

 inreplsp

FUNCTION

 Replace all occurrences of characters lexically less than SP (blank)
 by SP in the input string, returning modified string of same length.
 Also replace a '=' by a SP.

COPYRIGHT

 Copyright (C) 1998-2017 ABINIT group (DCA, XG, GMR).
 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

  string=character string to be modified

OUTPUT

  (see side effects)

SIDE EFFECTS

  string=same character string with ASCII (decimal) 0-31 replaced by 32.

PARENTS

      incomprs

CHILDREN

SOURCE

34 #if defined HAVE_CONFIG_H
35 #include "config.h"
36 #endif
37 
38 #include "abi_common.h"
39 
40 
41 subroutine inreplsp(string)
42 
43  use m_profiling_abi
44 
45  use defs_basis
46 
47 !This section has been created automatically by the script Abilint (TD).
48 !Do not modify the following lines by hand.
49 #undef ABI_FUNC
50 #define ABI_FUNC 'inreplsp'
51 !End of the abilint section
52 
53  implicit none
54 
55 !Arguments ------------------------------------
56 !scalars
57  character(len=*),intent(inout) :: string
58 
59 !Local variables-------------------------------
60 !scalars
61  integer :: ilenth,length
62 
63 ! *************************************************************************
64 
65 !Get length of string
66  length=len(string)
67 
68 !Proceed only if string has nonzero length
69  if (length>0) then
70 
71 !  Do replacement by going through input
72 !  character string one character at a time
73    do ilenth=1,length
74      if (llt(string(ilenth:ilenth),' ')) then
75        string(ilenth:ilenth)=' '
76      end if
77      if(string(ilenth:ilenth)=='=')then
78        string(ilenth:ilenth)=' '
79      end if
80    end do
81 
82  end if
83 
84 end subroutine inreplsp