TABLE OF CONTENTS


ABINIT/m_fstrings [ Modules ]

[ Top ] [ Modules ]

NAME

  m_fstrings

FUNCTION

  This module contains basic tools to operate on Fortran strings.

COPYRIGHT

 Copyright (C) 2008-2018 ABINIT group (MG, XG, MT, DC)
 This file is distributed under the terms of the
 GNU General Public License, see ~abinit/COPYING
 or http://www.gnu.org/copyleft/gpl.txt .

PARENTS

CHILDREN

SOURCE

 21 #if defined HAVE_CONFIG_H
 22 #include "config.h"
 23 #endif
 24 
 25 #include "abi_common.h"
 26 
 27 MODULE m_fstrings
 28 
 29  use defs_basis, only : dp, std_out, ch10
 30 
 31  implicit none
 32 
 33  private
 34 
 35  public :: is_letter       ! Returns .TRUE. if ch is a letter and .FALSE. otherwise
 36  public :: is_digit        ! Returns .TRUE. if ch is a digit (0,1,...,9) and .FALSE. otherwise
 37  public :: upper           ! Convert lower case letters to UPPER CASE
 38  public :: toupper         ! Convert lower case letters to UPPER CASE (function version)
 39  public :: lower           ! Convert UPPER CASE letters to lower case
 40  public :: tolower         ! Convert UPPER CASE letters to lower case  (function version)
 41  public :: removesp        ! Removes spaces, tabs, and control characters in string str
 42  public :: replace_ch0     ! Replace final '\0' with whitespaces
 43  public :: lstrip          ! Remove leading spaces from string
 44  public :: replace         ! Replace chars in string.
 45  public :: ljust           ! Return a left-justified string of length width.
 46  public :: lpad            ! Pad a string adding repeat characters fillchar on the left side.
 47  public :: round_brackets  ! Return a new string enclosed in parentheses if not already present.
 48  public :: quote           ! Return a new string enclosed by quotation marks.
 49  public :: rmquotes        ! Remove quotation marks from a string. Return new string
 50  public :: write_num       ! Writes a number to a string using format fmt
 51  public :: trimzero        ! Deletes nonsignificant trailing zeroes from a number string.
 52  public :: writeq          ! Writes a string of the form <name> = value to unit
 53  public :: strcat          ! Concatenate strings (function version)
 54  public :: sjoin           ! Joins strings with a space separator.
 55  public :: yesno           ! Convert boolean to "yes", "no"
 56  public :: itoa            ! Convert an integer into a string
 57  public :: ftoa            ! Convert a float into a string
 58  public :: ktoa            ! Convert a k-point into a string.
 59  public :: ltoa            ! Convert a list into a string.
 60  public :: atoi            ! Convert a string into a integer
 61  public :: basename        ! Returns the final component of a pathname.
 62  public :: firstchar       ! Returns .TRUE. is the first character in a string belongs to a gives set.
 63  public :: startswith      ! Returns .TRUE. is the string starts with the specified prefix.
 64  public :: endswith        ! Returns .True if the string ends with the specified suffix.
 65  public :: indent          ! Indent text
 66  public :: prep_dash       ! Prepend `-` to each line in a string.
 67  public :: int2char4       ! Convert a positive integer number (zero included) to a character(len=*)
 68                            ! with trailing zeros if the number is <=9999
 69  public :: int2char10      ! Convert a positive integer number (zero included) to a character(len=10)
 70                            ! with trailing blanks
 71  public :: char_count      ! Count the occurrences of a character in a string.
 72  public :: next_token      ! Tokenize a string made of whitespace-separated tokens.
 73  public :: inupper         ! Maps all characters in string to uppercase except for tokens between quotation marks.
 74 
 75  !TODO method to center a string
 76 
 77  interface write_num
 78    module procedure write_rdp_0D
 79    module procedure write_int_0D
 80  end interface write_num
 81 
 82  interface writeq
 83    module procedure writeq_rdp_0D
 84    module procedure writeq_int_0D
 85  end interface writeq
 86 
 87  interface is_digit
 88    module procedure is_digit_0D
 89  end interface is_digit
 90 
 91  interface firstchar
 92    module procedure firstchar_0d
 93    module procedure firstchar_1d
 94  end interface firstchar
 95 
 96  interface sjoin
 97    module procedure sjoin_2
 98    module procedure sjoin_3
 99    module procedure sjoin_4
100    module procedure sjoin_5
101    module procedure sjoin_6
102    module procedure sjoin_7
103  end interface sjoin
104 
105  interface strcat
106    module procedure strcat_2
107    module procedure strcat_3
108    module procedure strcat_4
109  end interface strcat
110 
111  interface ltoa
112    module procedure ltoa_int
113    module procedure ltoa_dp
114  end interface ltoa
115 
116   character(len=1),parameter :: BLANK=' '
117   character(len=1),parameter :: NCHAR = char(10)
118   character(len=1),parameter :: DIR_SEPARATOR = '/'
119 
120   integer,parameter :: ASCII_A=ICHAR('A')
121   integer,parameter :: ASCII_Z=ICHAR('Z')
122   integer,parameter :: ASCII_aa=ICHAR('a')
123   integer,parameter :: ASCII_zz=ICHAR('z')
124   integer,parameter :: SHIFT=ASCII_aa-ASCII_A ! Capital letters have smaller Dec value in the ASCII table.
125   integer,parameter :: ASCII_0=ICHAR('0')
126   integer,parameter :: ASCII_9=ICHAR('9')
127 
128   integer,parameter :: MAX_SLEN=500
129 
130 CONTAINS  !===========================================================

m_fstring/basename [ Functions ]

[ Top ] [ Functions ]

NAME

 basename

FUNCTION

  Returns the final component of a pathname.

INPUTS

  string=The input string

NOTES

  * If the input string in not a valid path to a file (i.e not in the form foo/name)
    a blank strink is returned
  * We do a backward search becase we want to optimize the algorithm for Fortran strings.

SOURCE

1605 pure function basename(string)
1606 
1607 
1608 !This section has been created automatically by the script Abilint (TD).
1609 !Do not modify the following lines by hand.
1610 #undef ABI_FUNC
1611 #define ABI_FUNC 'basename'
1612 !End of the abilint section
1613 
1614  character(len=*),intent(in) :: string
1615  character(len=LEN_TRIM(string)) :: basename
1616 
1617 !Local variables-------------------------------
1618  integer :: ic,nch_trim,nch
1619 !************************************************************************
1620 
1621  nch     =LEN     (string)
1622  nch_trim=LEN_TRIM(string)
1623 
1624  ic = INDEX (TRIM(string), DIR_SEPARATOR, back=.TRUE.)
1625  !write(*,*)'DEBUG ',TRIM(string),ic
1626 
1627  if (ic >= 1 .and. ic <= nch_trim-1) then ! there is stuff after the separator.
1628   basename = string(ic+1:nch_trim)
1629   return
1630  else if (ic==0 .or. ic == nch_trim+1) then ! no separator in string or zero length string,
1631   basename = TRIM(string)                   ! return trimmed string.
1632   return
1633  else              ! (ic == nch_trim) separator is the last char.
1634   basename= BLANK  ! This is not a valid path to a file, return blank.
1635   return
1636  end if
1637 
1638 end function basename

m_fstring/endswith [ Functions ]

[ Top ] [ Functions ]

NAME

 endswith

FUNCTION

  Returns .TRUE. is the string ends with the specified suffix

SOURCE

1802 pure function endswith(string, suffix) result(ans)
1803 
1804 
1805 !This section has been created automatically by the script Abilint (TD).
1806 !Do not modify the following lines by hand.
1807 #undef ABI_FUNC
1808 #define ABI_FUNC 'endswith'
1809 !End of the abilint section
1810 
1811  logical :: ans
1812  character(len=*),intent(in) :: string
1813  character(len=*),intent(in) :: suffix
1814 
1815 !Local variables-------------------------------
1816  integer :: ii,p,lenstr,lensuf
1817 !************************************************************************
1818 
1819  ans = .False.
1820  lenstr = len_trim(string); lensuf = len_trim(suffix)
1821  if (lensuf > lenstr) return
1822 
1823  do ii=1,lensuf
1824    p = lenstr - lensuf + ii
1825    if (suffix(ii:ii) /= string(p:p)) return
1826  end do
1827  ans = .True.
1828 
1829 end function endswith

m_fstring/firstchar_0d [ Functions ]

[ Top ] [ Functions ]

NAME

 firstchar_0d

FUNCTION

   Return True if string starts with the specified character

INPUTS

  string=The string whose first character has to be cheched
  ch=Character
  [csens]=.TRUE. if comparison is done regardless of case. Defaults to .FALSE.

PARENTS

CHILDREN

SOURCE

1662 pure function firstchar_0d(string,ch,csens) result(ans)
1663 
1664 
1665 !This section has been created automatically by the script Abilint (TD).
1666 !Do not modify the following lines by hand.
1667 #undef ABI_FUNC
1668 #define ABI_FUNC 'firstchar_0d'
1669 !End of the abilint section
1670 
1671  logical :: ans
1672  logical,optional,intent(in) :: csens
1673  character(len=*),intent(in) :: string
1674  character(len=1),intent(in) :: ch
1675 
1676 !Local variables-------------------------------
1677  logical :: my_csens
1678 !************************************************************************
1679 
1680  my_csens=.FALSE.; if (PRESENT(csens)) my_csens = csens
1681 
1682  if (.not.my_csens) then
1683    ans = ( string(1:1) == ch)
1684  else
1685    ans = ( toupper(string(1:1)) == toupper(ch))
1686  end if
1687 
1688 end function firstchar_0d

m_fstring/firstchar_1d [ Functions ]

[ Top ] [ Functions ]

NAME

 firstchar_1d

FUNCTION

  Returns .TRUE. is the first character of the string belongs to a given list.

INPUTS

  string=The string whose first character has to be cheched
  char_list=The list of characters.
  [csens]=.TRUE. if comparison is done regardless of case. Defaults to .FALSE.

PARENTS

CHILDREN

SOURCE

1712 pure function firstchar_1d(string,char_list,csens) result(ans)
1713 
1714 
1715 !This section has been created automatically by the script Abilint (TD).
1716 !Do not modify the following lines by hand.
1717 #undef ABI_FUNC
1718 #define ABI_FUNC 'firstchar_1d'
1719 !End of the abilint section
1720 
1721  logical :: ans
1722  logical,optional,intent(in) :: csens
1723  character(len=*),intent(in) :: string
1724  character(len=1),intent(in) :: char_list(:)
1725 
1726 !Local variables-------------------------------
1727  integer :: ii
1728  logical :: my_csens
1729  character(len=1) :: first_ch
1730 !************************************************************************
1731 
1732  my_csens=.FALSE.; if (PRESENT(csens)) my_csens = csens
1733 
1734  first_ch = string(1:1)
1735 
1736  ans=.FALSE.
1737 
1738  if (.not.my_csens) then
1739    do ii=1,SIZE(char_list)
1740      ans = ( first_ch == char_list(ii) ); if (ans) EXIT
1741    end do
1742  else
1743    do ii=1,SIZE(char_list)
1744      ans = ( toupper(first_ch) == toupper(char_list(ii)) ); if (ans) EXIT
1745    end do
1746  end if
1747 
1748 end function firstchar_1d

m_fstring/startswith [ Functions ]

[ Top ] [ Functions ]

NAME

 startswith

FUNCTION

  Returns .TRUE. is the string starts with the specified prefix.

SOURCE

1762 pure function startswith(string, prefix) result(ans)
1763 
1764 
1765 !This section has been created automatically by the script Abilint (TD).
1766 !Do not modify the following lines by hand.
1767 #undef ABI_FUNC
1768 #define ABI_FUNC 'startswith'
1769 !End of the abilint section
1770 
1771  logical :: ans
1772  character(len=*),intent(in) :: string
1773  character(len=*),intent(in) :: prefix
1774 
1775 !Local variables-------------------------------
1776  integer :: ii,lenstr,lenpre
1777 !************************************************************************
1778 
1779  ans = .False.
1780  lenstr = len_trim(string); lenpre = len_trim(prefix)
1781  if (lenpre > lenstr) return
1782 
1783  do ii=1,lenpre
1784    if (prefix(ii:ii) /= string(ii:ii)) return
1785  end do
1786  ans = .True.
1787 
1788 end function startswith

m_fstrings/atoi [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

 atoi

FUNCTION

  Convert a string into a integer


m_fstrings/char_count [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

 chcount

FUNCTION

   Count the occurrences of a character in a string.

PARENTS

SOURCE

2111 integer pure function char_count(string, char)
2112 
2113 
2114 !This section has been created automatically by the script Abilint (TD).
2115 !Do not modify the following lines by hand.
2116 #undef ABI_FUNC
2117 #define ABI_FUNC 'char_count'
2118 !End of the abilint section
2119 
2120  implicit none
2121 
2122 !Arguments ------------------------------------
2123 !scalars
2124  character(len=*),intent(in) :: string
2125  character(len=1),intent(in) :: char
2126  integer :: i
2127 
2128 ! *************************************************************************
2129  char_count = 0
2130  do i=1,len(string)
2131    if (string(i:i) == char) char_count = char_count + 1
2132  end do
2133 
2134 end function char_count

m_fstrings/ftoa [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

 ftoa

FUNCTION

  Convert an float into a string using format fmt  (es16.6 if fmt is not given).

PARENTS

CHILDREN


m_fstrings/indent [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

  indent

FUNCTION

  Indent text

INPUTS

   istr=Input string

PARENTS

CHILDREN

SOURCE

1848 pure function indent(istr) result(ostr)
1849 
1850 
1851 !This section has been created automatically by the script Abilint (TD).
1852 !Do not modify the following lines by hand.
1853 #undef ABI_FUNC
1854 #define ABI_FUNC 'indent'
1855 !End of the abilint section
1856 
1857  character(len=*),intent(in) :: istr
1858  character(len=len(istr)*4+4) :: ostr
1859 
1860 !Local variables-------------------------------
1861  integer,parameter :: n=4 ! ostr is large enough to allocate all the possible indentations.
1862  integer :: ii,jj,kk
1863  character(len=1) :: ch
1864 
1865 ! *********************************************************************
1866 
1867  ostr = " "
1868  jj = n
1869  do ii=1,LEN_TRIM(istr)
1870    ch = istr(ii:ii)
1871    jj = jj + 1
1872    if (ch == NCHAR) then
1873       ostr(jj:jj) = NCHAR
1874       do kk=jj+1,jj+n
1875         ostr(kk:kk) = " "
1876       end do
1877       jj = jj+n
1878    else
1879      ostr(jj:jj) = ch
1880    end if
1881  end do
1882  !ostr(jj+1:) = "H"
1883 
1884 end function indent

m_fstrings/int2char10 [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

 int2char10

FUNCTION

 Convert a positive integer number (zero included) to a character(len=10),
 with blanks to COMPLETE the string.
 Exemple : 1234 will be mapped to "1234      "
 Makes sure that the integer is between 0 and 9 999 999 999
 Should be enough for integer*4

INPUTS

  iint=integer to be converted

OUTPUT

  string=character string ('##########' if error)

PARENTS

      handle_ncerr,m_esymm,m_dfti,m_dyson_solver,m_qparticles,m_wfd
      prt_cif,wffile

CHILDREN

SOURCE

2050 pure subroutine int2char10(iint,string)
2051 
2052 
2053 !This section has been created automatically by the script Abilint (TD).
2054 !Do not modify the following lines by hand.
2055 #undef ABI_FUNC
2056 #define ABI_FUNC 'int2char10'
2057 !End of the abilint section
2058 
2059  implicit none
2060 
2061 !Arguments ------------------------------------
2062 !scalars
2063  integer,intent(in) :: iint
2064  character(len=10),intent(out) :: string
2065 
2066 ! *************************************************************************
2067 
2068 !Note the use of floating numbers instead of large integers, for portability
2069  if(iint<0 .or. iint>=1.d10)then
2070    string='####'
2071    return
2072  end if
2073  if(iint<10)then
2074    write(string,'(i1,9x)')iint
2075  else if(iint<100)then
2076    write(string,'(i2,8x)')iint
2077  else if(iint<1.0d3)then
2078    write(string,'(i3,7x)')iint
2079  else if(iint<1.0d4)then
2080    write(string,'(i4,6x)')iint
2081  else if(iint<1.0d5)then
2082    write(string,'(i5,5x)')iint
2083  else if(iint<1.0d6)then
2084    write(string,'(i6,4x)')iint
2085  else if(iint<1.0d7)then
2086    write(string,'(i7,3x)')iint
2087  else if(iint<1.0d8)then
2088    write(string,'(i8,2x)')iint
2089  else if(iint<1.0d9)then
2090    write(string,'(i9,1x)')iint
2091  else
2092    write(string,'(i10)')iint
2093  end if
2094 
2095 end subroutine int2char10

m_fstrings/int2char4 [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

 int2char4

FUNCTION

 Convert an integer number to ("2") a character(len=*)
 with trailing zeros if the number is <=9999.
 Exemple : 123 will be mapped to "0123" ; 12345 will be mapped to "12345"
 Makes sure that the integer fits the string length
 (ex.: between 0 and 99999 if the string is a character(len=5)).

INPUTS

  iint=integer to be converted

OUTPUT

  string=character string ('####...' if error)

PARENTS

      aim,anaddb,dtfil_init1,gaus_dos,get_all_gkq,iofn1,m_atprj,m_green
      m_io_redirect,m_phonon_supercell,m_self,mrgscr,optic,pawmkaewf
      prtfatbands,read_wfrspa,scfcv,tetrahedron

CHILDREN

SOURCE

1970 pure subroutine int2char4(iint,string)
1971 
1972 
1973 !This section has been created automatically by the script Abilint (TD).
1974 !Do not modify the following lines by hand.
1975 #undef ABI_FUNC
1976 #define ABI_FUNC 'int2char4'
1977 !End of the abilint section
1978 
1979  implicit none
1980 
1981 !Arguments ------------------------------------
1982 !scalars
1983  integer,intent(in) :: iint
1984  character(len=*),intent(out) :: string
1985 
1986 !Local variables-------------------------------
1987  integer :: lenstr
1988 
1989 ! *************************************************************************
1990 
1991  lenstr=min(len(string),25)
1992  if(iint<0 .or. iint>10._dp**(lenstr-1))then
1993    string=repeat('#',lenstr)
1994    return
1995  end if
1996  if(iint<10)then
1997    write(string,'("000",i1)')iint
1998  else if(iint<100)then
1999    write(string,'("00",i2)')iint
2000  else if(iint<1000)then
2001    write(string,'("0",i3)')iint
2002  else if(iint<10000)then
2003    write(string,'(i4)')iint
2004  else if(iint<1.0d5)then
2005    write(string,'(i5)')iint
2006  else if(iint<1.0d6)then
2007    write(string,'(i6)')iint
2008  else if(iint<1.0d7)then
2009    write(string,'(i7)')iint
2010  else if(iint<1.0d8)then
2011    write(string,'(i8)')iint
2012  else if(iint<1.0d9)then
2013    write(string,'(i9)')iint
2014  else if(iint<1.0d9)then
2015    write(string,'(i10)')iint
2016  else
2017    string=repeat('#',lenstr)
2018  end if
2019 
2020 end subroutine int2char4

m_fstrings/inupper [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

 inupper

FUNCTION

 Maps all characters in string to uppercase except for tokens between quotation marks.
 Uses fortran90 character string manipulation but should work
 independent of EBCDIC or ASCII assumptions--only relies on
 'index' intrinsic character string matching function.
 Makes sure that the string 'lolett' remains defined as the lower
 case 26-character alphabet string and 'uplett' remains upper case.

INPUTS

  string= character string with arbitrary case

OUTPUT

  string= same character string mapped to upper case

SIDE EFFECTS

  string= (input) character string with arbitrary case
          (output) same character string mapped to upper case

PARENTS

      anaddb,band2eps,chkvars,intagm,invars1,m_ab7_invars_f90
      m_anaddb_dataset,m_exit,multibinit,parsefile

CHILDREN

SOURCE

2232 subroutine inupper(string)
2233 
2234 
2235 !This section has been created automatically by the script Abilint (TD).
2236 !Do not modify the following lines by hand.
2237 #undef ABI_FUNC
2238 #define ABI_FUNC 'inupper'
2239 !End of the abilint section
2240 
2241  implicit none
2242 
2243 !Arguments ------------------------------------
2244 !scalars
2245  character(len=*),intent(inout) :: string
2246 
2247 !Local variables-------------------------------
2248 !scalars
2249  integer :: ii,indx,inquotes
2250  logical,save :: first=.true.
2251  character(len=1) :: cc
2252  !character(len=500) :: message
2253  character(len=26), parameter :: uplett='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
2254  character(len=26), parameter :: lolett='abcdefghijklmnopqrstuvwxyz'
2255 
2256 ! *************************************************************************
2257 !
2258 !On first entry make sure lower case letters stayed
2259 !lower case and upper case letters stayed upper case
2260  if (first) then
2261    do ii=1,26
2262 !    Look for occurrence of each upper case character
2263 !    anywhere in string of all lower case letters
2264      indx=index(lolett,uplett(ii:ii))
2265 !    If found then print error message and quit
2266      if (indx>0) then
2267        write(std_out, '(a,a,a,a,a,a,a,a,a)' )&
2268 &       'Upper case string = ',uplett,ch10,&
2269 &       'Lower case string = ',lolett,ch10,&
2270 &       'Upper case character ',uplett(ii:ii),'found in supposedly lower case string.'
2271        stop
2272      end if
2273    end do
2274    first=.false.
2275  end if
2276 
2277  inquotes = 0
2278  do ii=1,len_trim(string)
2279 !  Pick off single character of string (one byte):
2280    cc=string(ii:ii)
2281 
2282    ! Ignore tokens between quotation marks.
2283    if (cc == "'" .or. cc == '"') inquotes = inquotes + 1
2284    if (inquotes == 1) cycle
2285    if (inquotes == 2) then
2286      inquotes = 0; cycle
2287    end if
2288    ! determine whether a lowercase letter:
2289    indx=index(lolett,cc)
2290    ! Map to uppercase:
2291    if (indx>0) string(ii:ii)=uplett(indx:indx)
2292  end do
2293 
2294 end subroutine inupper

m_fstrings/is_digit_0D [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

  is_digit_0D

FUNCTION

  Returns .TRUE. if ch is a digit (0,1,...,9) and .FALSE. otherwise.

SOURCE

174 pure function is_digit_0D(ch) result(ans)
175 
176 !Arguments ------------------------------------
177 
178 !This section has been created automatically by the script Abilint (TD).
179 !Do not modify the following lines by hand.
180 #undef ABI_FUNC
181 #define ABI_FUNC 'is_digit_0D'
182 !End of the abilint section
183 
184  character(len=1),intent(in) :: ch
185  logical :: ans
186 ! *********************************************************************
187 
188  select case (ICHAR(ch))
189  case(ASCII_0:ASCII_9)
190    ans=.TRUE.
191  case default
192    ans=.FALSE.
193  end select
194 
195 end function is_digit_0D

m_fstrings/is_letter [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

  is_letter

FUNCTION

  Returns .TRUE. if ch is a letter and .FALSE. otherwise.

SOURCE

142 pure function is_letter(ch) result(ans)
143 
144 
145 !This section has been created automatically by the script Abilint (TD).
146 !Do not modify the following lines by hand.
147 #undef ABI_FUNC
148 #define ABI_FUNC 'is_letter'
149 !End of the abilint section
150 
151  character(len=1),intent(in) :: ch
152  logical :: ans
153 ! *********************************************************************
154 
155  select case (ICHAR(ch))
156  case (ASCII_A:ASCII_Z,ASCII_aa:ASCII_zz)
157    ans=.TRUE.
158  case DEFAULT
159    ans=.FALSE.
160  end select
161 
162 end function is_letter

m_fstrings/itoa [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

 itoa

FUNCTION

  Convert an integer into a string

INPUTS

  value=The integer

PARENTS

CHILDREN


m_fstrings/ktoa [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

 ktoa

FUNCTION

  Convert an k-point into a string using format fmt  (es.16.6 if fmt is not given).

PARENTS

CHILDREN


m_fstrings/ljust [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

  ljust

FUNCTION

  Return S left-justified in a string of length width. Padding is
  done using the specified fill character (default is a space).

SOURCE

534 pure function ljust(istr, width, fillchar) result(ostr)
535 
536 
537 !This section has been created automatically by the script Abilint (TD).
538 !Do not modify the following lines by hand.
539 #undef ABI_FUNC
540 #define ABI_FUNC 'ljust'
541 !End of the abilint section
542 
543  character(len=*),intent(in) :: istr
544  integer,intent(in) :: width
545  character(len=width) :: ostr
546  character(len=1),optional,intent(in) :: fillchar
547 
548 !Local variables-------------------------------
549  integer :: ii
550 ! *********************************************************************
551 
552  ostr = ADJUSTL(istr)
553 
554  if (PRESENT(fillchar)) then
555    do ii=LEN_TRIM(ostr)+1,width
556      ostr(ii:ii) = fillchar
557    end do
558  end if
559 
560 end function ljust

m_fstrings/lower [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

  lower

FUNCTION

  Convert UPPER CASE letters to lower case.

PARENTS

      fftprof,ioprof,lapackprof

CHILDREN

SOURCE

285 pure subroutine lower(str)
286 
287 
288 !This section has been created automatically by the script Abilint (TD).
289 !Do not modify the following lines by hand.
290 #undef ABI_FUNC
291 #define ABI_FUNC 'lower'
292 !End of the abilint section
293 
294  character(len=*),intent(inout) :: str
295 
296 !Local variables-------------------------------
297  integer :: ic,iasc
298 ! *********************************************************************
299 
300  do ic=1,LEN_TRIM(str)
301    iasc=IACHAR(str(ic:ic))
302    if (iasc>=ASCII_A.and.iasc<=ASCII_Z) str(ic:ic)=ACHAR(iasc+SHIFT)
303  end do
304 
305 end subroutine lower

m_fstrings/lpad [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

  lpad

FUNCTION

  Pad a string adding repeat characters fillchar on the left side.
  Padding is done using the specified fill character (default is a blanck character).

INPUTS

OUTPUT

PARENTS

CHILDREN

SOURCE

583 pure function lpad(istr, repeat, fillchar) result(ostr)
584 
585 
586 !This section has been created automatically by the script Abilint (TD).
587 !Do not modify the following lines by hand.
588 #undef ABI_FUNC
589 #define ABI_FUNC 'lpad'
590 !End of the abilint section
591 
592  character(len=*),intent(in) :: istr
593  integer,intent(in) :: repeat
594  character(len=LEN_TRIM(istr) + repeat) :: ostr
595  character(len=1),optional,intent(in) :: fillchar
596 
597 !Local variables-------------------------------
598  integer :: ii
599  character(len=1) :: ch
600 ! *********************************************************************
601 
602  ostr(repeat+1:) = TRIM(istr)
603 
604  ch = " "; if (PRESENT(fillchar)) ch = fillchar
605  do ii=1,repeat
606    ostr(ii:ii) = ch
607  end do
608 
609 end function lpad

m_fstrings/lstrip [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

  lstrip

FUNCTION

  Removes leading spaces from the input string.

SOURCE

492 pure function lstrip(istr) result(ostr)
493 
494 
495 !This section has been created automatically by the script Abilint (TD).
496 !Do not modify the following lines by hand.
497 #undef ABI_FUNC
498 #define ABI_FUNC 'lstrip'
499 !End of the abilint section
500 
501  character(len=*),intent(in) :: istr
502  character(len=len(istr)) :: ostr
503 
504 !Local variables-------------------------------
505  integer :: ii,jj,lg
506 ! *********************************************************************
507 
508  lg=LEN(istr)
509  do ii=1,lg
510    if (istr(ii:ii)/=BLANK) EXIT
511  end do
512 
513  ostr = " "
514  do jj=1,lg-ii+1
515    ostr(jj:jj) = istr(ii:ii)
516    ii=ii+1
517  end do
518 
519 end function lstrip

m_fstrings/ltoa_dp [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

 ltoa_dp

FUNCTION

  Convert a list of double precision numbers into a string.
  fmt specifies the format to be used ("es13.4" by default)

PARENTS

CHILDREN


m_fstrings/ltoa_int [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

 ltoa_int

FUNCTION

  Convert a list of integers into a string.

PARENTS

CHILDREN


m_fstrings/next_token [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

 next_token

FUNCTION

  Assume a string with whitespace-separated tokens.
  Find the next token starting from `start`, return it in `ostr` and update `start`
  so that one can call the function inside a loop.
  Return exit status.

PARENTS

SOURCE

2153 integer function next_token(string, start, ostr) result(ierr)
2154 
2155 
2156 !This section has been created automatically by the script Abilint (TD).
2157 !Do not modify the following lines by hand.
2158 #undef ABI_FUNC
2159 #define ABI_FUNC 'next_token'
2160 !End of the abilint section
2161 
2162  implicit none
2163 
2164 !Arguments ------------------------------------
2165 !scalars
2166  character(len=*),intent(in) :: string
2167  character(len=*),intent(out) :: ostr
2168  integer,intent(inout) :: start
2169 
2170 !Local variables-------------------------------
2171  integer :: ii,beg
2172 
2173 ! *************************************************************************
2174 
2175  ierr = 1; beg = 0
2176  ! Find first non-empty char.
2177  do ii=start,len_trim(string)
2178    if (string(ii:ii) /= " ") then
2179      beg = ii; exit
2180    end if
2181  end do
2182  if (beg == 0) return
2183 
2184  ! Find end of token.
2185  start = 0
2186  do ii=beg,len_trim(string)
2187    if (string(ii:ii) == " ") then
2188      start = ii; exit
2189    end if
2190  end do
2191  ! Handle end of string.
2192  if (start == 0) start = len_trim(string) + 1
2193 
2194  ierr = 0
2195  ostr = string(beg:start-1)
2196 
2197 end function next_token

m_fstrings/prep_dash [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

  prep_dash

FUNCTION

  Prepend `-` to each line in a string.

INPUTS

   istr=Input string

PARENTS

CHILDREN

SOURCE

1905 pure function prep_dash(istr) result(ostr)
1906 
1907 
1908 !This section has been created automatically by the script Abilint (TD).
1909 !Do not modify the following lines by hand.
1910 #undef ABI_FUNC
1911 #define ABI_FUNC 'prep_dash'
1912 !End of the abilint section
1913 
1914  character(len=*),intent(in) :: istr
1915  character(len=2*len(istr)) :: ostr
1916 
1917 !Local variables-------------------------------
1918  integer :: ii,jj
1919  character(len=1) :: ch
1920 
1921 ! *********************************************************************
1922  ostr = ""
1923  jj = 1; ostr(jj:jj) = "-"
1924  !jj = 0
1925 
1926  do ii=1,LEN_TRIM(istr)
1927    ch = istr(ii:ii)
1928    jj = jj + 1
1929    if (ch == ch10) then
1930       ostr(jj:jj) = ch10
1931       ostr(jj+1:jj+1) = "-"
1932       jj = jj+1
1933    else
1934      ostr(jj:jj) = ch
1935    end if
1936  end do
1937  !ostr(jj+1:) = "H"
1938 
1939 end function prep_dash

m_fstrings/quote [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

  quote

FUNCTION

  Return a new string enclosed by quotation marks.

SOURCE

678 pure function quote(istr) result(ostr)
679 
680 
681 !This section has been created automatically by the script Abilint (TD).
682 !Do not modify the following lines by hand.
683 #undef ABI_FUNC
684 #define ABI_FUNC 'quote'
685 !End of the abilint section
686 
687  character(len=*),intent(in) :: istr
688  character(len=LEN_TRIM(istr)+2) :: ostr
689 
690 !Local variables-------------------------------
691  integer :: ii
692  character(len=1) :: qq
693  character(len=LEN(istr)+2) :: tmp
694 
695 ! *********************************************************************
696 
697  do ii=1,LEN(istr)
698    if (istr(ii:ii)/=BLANK) EXIT
699  end do
700 
701  qq = istr(ii:ii)
702 
703  if (qq == "'" .or. qq == '"') then
704    ! Don't add quotation marks if they already present.
705    tmp = istr
706    ii = LEN_TRIM(tmp)
707    ! If the string is not closed, fix it.
708    if (tmp(ii:ii) /= qq) tmp(ii+1:ii+1) = qq
709    ostr = TRIM(tmp)
710 
711  else
712    qq = '"'
713    ostr(1:1) = qq
714    ostr(2:) = TRIM(istr)
715    ii = LEN_TRIM(ostr)+1
716    ostr(ii:ii) = qq
717  end if
718 
719 end function quote

m_fstrings/removesp [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

  removesp

FUNCTION

  Removes spaces, tabs, and control characters in string str.

INPUTS

OUTPUT

PARENTS

CHILDREN

      trimzero,write_num

SOURCE

367 subroutine removesp(str)
368 
369 
370 !This section has been created automatically by the script Abilint (TD).
371 !Do not modify the following lines by hand.
372 #undef ABI_FUNC
373 #define ABI_FUNC 'removesp'
374 !End of the abilint section
375 
376  character(len=*),intent(inout) :: str
377 
378 !Local variables-------------------------------
379  integer :: i,k,lenstr,ich
380  character(len=1):: ch
381  character(len=LEN_TRIM(str)):: outstr
382 ! *********************************************************************
383 
384  str=ADJUSTL(str) ; lenstr=LEN_TRIM(str)
385 
386  outstr=BLANK ; k=0
387  do i=1,lenstr
388    ch=str(i:i)
389    ich=IACHAR(ch)
390    select case(ich)
391    case(0:32)  ! space, tab, or control character
392      CYCLE
393    case(33:)
394      k=k+1
395      outstr(k:k)=ch
396    end select
397  end do
398 
399  str=ADJUSTL(outstr)
400 
401 end subroutine removesp

m_fstrings/replace [ Modules ]

[ Top ] [ m_fstrings ] [ Modules ]

NAME

  replace

FUNCTION

  Replace `text` with `rep` in string `s`. Return new string.

 NOTES:
  The length of the output string is increased by 500 but this could not be enough
  if len_trim(text) > len_trim(re) and there are several occurrences of `text` in s.

SOURCE

451 function replace(s, text, rep)  result(outs)
452 
453 
454 !This section has been created automatically by the script Abilint (TD).
455 !Do not modify the following lines by hand.
456 #undef ABI_FUNC
457 #define ABI_FUNC 'replace'
458 !End of the abilint section
459 
460  character(len=*),intent(in) :: s,text,rep
461  character(len(s)+500) :: outs     ! provide outs with extra 500 char len
462 
463 !Local variables-------------------------------
464  integer :: i, j, nt, nr, last
465 ! *********************************************************************
466 
467  outs = s; nt = len_trim(text); nr = len_trim(rep); last = 1
468  do
469    i = index(outs(last:), text(1:nt)); if (i == 0) exit
470    j = last + i - 1; last = j + nr
471    if (j - 1 < 1) then
472      outs = rep(:nr) // outs(j+nt:)
473    else
474      outs = outs(:j-1) // rep(:nr) // outs(j+nt:)
475    end if
476  end do
477 
478 end function replace

m_fstrings/replace_ch0 [ Modules ]

[ Top ] [ m_fstrings ] [ Modules ]

NAME

  replace_ch0

FUNCTION

  Little tool to change all final '\0' (end of string in C) characters to ' ' (space).

SIDE EFFECTS

  * string = the string to convert. It is done in-place.

SOURCE

416 elemental subroutine replace_ch0(string)
417 
418 
419 !This section has been created automatically by the script Abilint (TD).
420 !Do not modify the following lines by hand.
421 #undef ABI_FUNC
422 #define ABI_FUNC 'replace_ch0'
423 !End of the abilint section
424 
425   character(len=*), intent(inout) :: string
426 
427   integer :: i, l
428 
429   i = index(string, char(0))
430   if (i > 0) then
431      l = len(string)
432      string(i:l) = repeat(" ", l - i + 1)
433   end if
434 
435 end subroutine replace_ch0

m_fstrings/rmquotes [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

  rmquotes

FUNCTION

  Remove quotation marks from a string. Return new string

SOURCE

733 pure function rmquotes(istr) result(ostr)
734 
735 
736 !This section has been created automatically by the script Abilint (TD).
737 !Do not modify the following lines by hand.
738 #undef ABI_FUNC
739 #define ABI_FUNC 'rmquotes'
740 !End of the abilint section
741 
742  character(len=*),intent(in) :: istr
743  character(len=len(istr)) :: ostr
744 
745 !Local variables-------------------------------
746  integer :: ii,cnt
747 
748 ! *********************************************************************
749 
750  ostr = ""; cnt = 0
751  do ii=1,len_trim(istr)
752    if (any(istr(ii:ii) == ["'", '"'])) cycle
753    cnt = cnt + 1
754    ostr(cnt:cnt) = istr(ii:ii)
755  end do
756 
757 end function rmquotes

m_fstrings/round_brackets [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

  round_brackets

FUNCTION

  Return a new string enclosed in parentheses if not already present.

SOURCE

623 pure function round_brackets(istr) result(ostr)
624 
625 
626 !This section has been created automatically by the script Abilint (TD).
627 !Do not modify the following lines by hand.
628 #undef ABI_FUNC
629 #define ABI_FUNC 'round_brackets'
630 !End of the abilint section
631 
632  character(len=*),intent(in) :: istr
633  character(len=LEN_TRIM(istr)+2) :: ostr
634 
635 !Local variables-------------------------------
636  integer :: ii
637  character(len=1) :: qq
638  character(len=LEN(istr)+2) :: tmp
639 
640 ! *********************************************************************
641 
642  do ii=1,LEN(istr)
643    if (istr(ii:ii)/=BLANK) EXIT
644  end do
645 
646  qq = istr(ii:ii)
647 
648  if (qq == "(") then
649    ! Don't add quotation marks if they already present.
650    tmp = istr
651    ii = LEN_TRIM(tmp)
652    ! If the string is not closed, fix it.
653    if (tmp(ii:ii) /= ")") tmp(ii+1:ii+1) = ")"
654    ostr = TRIM(tmp)
655 
656  else
657    qq = '('
658    ostr(1:1) = qq
659    ostr(2:) = TRIM(istr)
660    ii = LEN_TRIM(ostr)+1
661    ostr(ii:ii) = ")"
662  end if
663 
664 end function round_brackets

m_fstrings/sjoin_2 [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

 sjoin_2

FUNCTION

  Joins two strings with a space separator except if first string is empty.


m_fstrings/sjoin_3 [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

 sjoin_3

FUNCTION

  Joins three strings with a space separator.


m_fstrings/sjoin_4 [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

 sjoin_4

FUNCTION

  Joins four strings with a space separator.


m_fstrings/sjoin_5 [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

 sjoin_5

FUNCTION

  Joins five strings with a space separator.


m_fstrings/sjoin_6 [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

 sjoin_6

FUNCTION

  Joins six strings with a space separator.


m_fstrings/sjoin_7 [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

 sjoin_7

FUNCTION

  Joins six strings with a space separator.


m_fstrings/strcat_2 [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

 strcat_2

FUNCTION

  Returns two concatenated strings.


m_fstrings/strcat_3 [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

 strcat_3

FUNCTION

  Concatenate 3 strings


m_fstrings/strcat_4 [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

 strcat_3

FUNCTION

  Concatenate 4 strings


m_fstrings/tolower [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

  tolower

FUNCTION

  Convert UPPER CASE letters to lower case (function version).

SOURCE

319 pure function tolower(str_in) result(str_out)
320 
321 
322 !This section has been created automatically by the script Abilint (TD).
323 !Do not modify the following lines by hand.
324 #undef ABI_FUNC
325 #define ABI_FUNC 'tolower'
326 !End of the abilint section
327 
328  character(len=*),intent(in) :: str_in
329  character(len=LEN_TRIM(str_in)) :: str_out
330 
331 !Local variables-------------------------------
332  integer :: ic,iasc
333 ! *********************************************************************
334 
335  do ic=1,LEN_TRIM(str_in)
336    iasc=IACHAR(str_in(ic:ic))
337    if (iasc>=ASCII_A.and.iasc<=ASCII_Z) then
338      str_out(ic:ic)=ACHAR(iasc+SHIFT)
339    else
340      str_out(ic:ic)=str_in(ic:ic)
341    end if
342  end do
343 
344 end function tolower

m_fstrings/toupper [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

  toupper

FUNCTION

  Convert lower case letters to UPPER CASE (function version).

SOURCE

241 pure function toupper(str_in) result(str_out)
242 
243 
244 !This section has been created automatically by the script Abilint (TD).
245 !Do not modify the following lines by hand.
246 #undef ABI_FUNC
247 #define ABI_FUNC 'toupper'
248 !End of the abilint section
249 
250  character(len=*),intent(in) :: str_in
251  character(len=LEN_TRIM(str_in)) :: str_out
252 
253 !Local variables-------------------------------
254  integer :: ic,iasc
255 ! *********************************************************************
256 
257  do ic=1,LEN_TRIM(str_in)
258    iasc=IACHAR(str_in(ic:ic))
259    if (iasc>=ASCII_aa.and.iasc<=ASCII_zz) then
260      str_out(ic:ic)=ACHAR(iasc-SHIFT)
261    else
262      str_out(ic:ic)=str_in(ic:ic)
263    end if
264  end do
265 
266 end function toupper

m_fstrings/trimzero [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

  trimzero

FUNCTION

 Deletes nonsignificant trailing zeroes from number string str. If number
 string ends in a decimal point, one trailing zero is added.

INPUTS

OUTPUT

PARENTS

      m_fstrings

CHILDREN

      trimzero,write_num

SOURCE

865 ! NOT sure it will work
866 
867 subroutine trimzero(str)
868 
869 
870 !This section has been created automatically by the script Abilint (TD).
871 !Do not modify the following lines by hand.
872 #undef ABI_FUNC
873 #define ABI_FUNC 'trimzero'
874 !End of the abilint section
875 
876  character(len=*),intent(inout) :: str
877 
878 !Local variables-------------------------------
879  integer :: i,ipos,lstr
880  character :: ch
881  character(len=10) :: sexp
882 ! *********************************************************************
883 
884  ipos=SCAN(str,'eE')
885  if (ipos>0) then
886   sexp=str(ipos:)
887   str=str(1:ipos-1)
888  end if
889  lstr=LEN_TRIM(str)
890  do i=lstr,1,-1
891   ch=str(i:i)
892   if (ch=='0') CYCLE
893   if (ch=='.') then
894    str=str(1:i)//'0'
895    if (ipos>0) str=TRIM(str)//TRIM(sexp)
896    EXIT
897   end if
898   str=str(1:i)
899   EXIT
900  end do
901 
902  if (ipos>0) str=TRIM(str)//TRIM(sexp)
903 
904 end subroutine trimzero

m_fstrings/upper [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

  upper

FUNCTION

  Convert lower case letters to UPPER CASE.

SOURCE

207 pure subroutine upper(str)
208 
209 
210 !This section has been created automatically by the script Abilint (TD).
211 !Do not modify the following lines by hand.
212 #undef ABI_FUNC
213 #define ABI_FUNC 'upper'
214 !End of the abilint section
215 
216  character(len=*),intent(inout) :: str
217 
218 !Local variables-------------------------------
219  integer :: ic,iasc
220 ! *********************************************************************
221 
222  do ic=1,LEN_TRIM(str)
223    iasc=IACHAR(str(ic:ic))
224    if (iasc>=ASCII_aa.and.iasc<=ASCII_zz) str(ic:ic)=ACHAR(iasc-SHIFT)
225  end do
226 
227 end subroutine upper

m_fstrings/write_int_0d [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

  write_int_0d

FUNCTION

  Writes a number to a string using format fmt.

PARENTS

CHILDREN

      trimzero,write_num

SOURCE

819 subroutine write_int_0D(inum,str,fmt)
820 
821 !Arguments ------------------------------------
822 
823 !This section has been created automatically by the script Abilint (TD).
824 !Do not modify the following lines by hand.
825 #undef ABI_FUNC
826 #define ABI_FUNC 'write_int_0D'
827 !End of the abilint section
828 
829  integer,intent(in) :: inum
830  character(len=*),intent(in) :: fmt
831  character(len=*),intent(out) :: str
832 
833 !Local variables-------------------------------
834  character(len=LEN(fmt)+2) :: formt
835 ! *********************************************************************
836 
837  formt='('//TRIM(fmt)//')'
838  write(str,formt) inum
839  str=ADJUSTL(str)
840 
841 end subroutine write_int_0D

m_fstrings/write_rdp_0d [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

  write_rdp_0d

FUNCTION

  Writes a number to a string using format fmt.

PARENTS

CHILDREN

      trimzero,write_num

SOURCE

776 subroutine write_rdp_0d(rnum,str,fmt)
777 
778 
779 !This section has been created automatically by the script Abilint (TD).
780 !Do not modify the following lines by hand.
781 #undef ABI_FUNC
782 #define ABI_FUNC 'write_rdp_0d'
783 !End of the abilint section
784 
785  implicit none
786 
787 !Arguments ------------------------------------
788  real(dp),intent(in) :: rnum
789  character(len=*),intent(in) :: fmt
790  character(len=*),intent(out) :: str
791 
792 !Local variables-------------------------------
793  character(len=LEN(fmt)+2) :: formt
794 ! *********************************************************************
795 
796  formt='('//TRIM(fmt)//')'
797  write(str,formt)rnum
798  str=ADJUSTL(str)
799 
800 end subroutine write_rdp_0D

m_fstrings/writeq_int_0D [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

  writeq_int_0D

FUNCTION

  Writes a string of the form <name> = value to unit.

INPUTS

OUTPUT

PARENTS

CHILDREN

      trimzero,write_num

SOURCE

971 subroutine writeq_int_0D(unit,namestr,ivalue,fmt)
972 
973 
974 !This section has been created automatically by the script Abilint (TD).
975 !Do not modify the following lines by hand.
976 #undef ABI_FUNC
977 #define ABI_FUNC 'writeq_int_0D'
978 !End of the abilint section
979 
980  integer,intent(in) :: ivalue
981  integer,intent(in) :: unit
982  character(len=*),intent(in) :: namestr
983  character(len=*),intent(in) :: fmt
984 
985 !Local variables-------------------------------
986  character(len=32) :: tempstr
987 ! *********************************************************************
988 
989  call write_num(ivalue,tempstr,fmt)
990  call trimzero(tempstr)
991  write(unit,*)TRIM(namestr)//' = '//TRIM(tempstr)
992 
993 end subroutine writeq_int_0D

m_fstrings/writeq_rdp_0D [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

  writeq_rdp_0D

FUNCTION

  Writes a string of the form <name> = value to unit.

INPUTS

OUTPUT

PARENTS

CHILDREN

      trimzero,write_num

SOURCE

926 subroutine writeq_rdp_0D(unit,namestr,value,fmt)
927 
928 
929 !This section has been created automatically by the script Abilint (TD).
930 !Do not modify the following lines by hand.
931 #undef ABI_FUNC
932 #define ABI_FUNC 'writeq_rdp_0D'
933 !End of the abilint section
934 
935  real(dp),intent(in) :: value
936  integer,intent(in) :: unit
937  character(len=*),intent(in) :: fmt
938  character(len=*),intent(in) :: namestr
939 
940 !Local variables-------------------------------
941  character(len=32) :: tempstr
942 ! *********************************************************************
943 
944  call write_num(value,tempstr,fmt)
945  call trimzero(tempstr)
946  write(unit,*)TRIM(namestr)//' = '//TRIM(tempstr)
947 
948 end subroutine writeq_rdp_0D

m_fstrings/yesno [ Functions ]

[ Top ] [ m_fstrings ] [ Functions ]

NAME

 yesno

FUNCTION

  Convert boolean into "yes" or "no"