"matches" and "capital" are in flib now

git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@1114 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
giannozz 2004-08-17 20:03:12 +00:00
parent 4c879bb7e8
commit b83d775f85
2 changed files with 3 additions and 79 deletions

View File

@ -346,53 +346,3 @@
!
!
end
!
! NB: "capital" and "matches" are in Module/parser.f90
! and in upftools/nclib.f90 as well !!!
!-----------------------------------------------------------------------
function matches (string1, string2)
!---------------------------------------------------------------------
!
implicit none
character*(*) string1, string2
logical matches
integer len1, len2, l
len1 = len(string1)
len2 = len(string2)
do l = 1, len2 - len1 + 1
if (string1 (1:len1) .eq.string2 (l:l + len1 - 1) ) then
matches = .true.
return
endif
enddo
matches = .false.
return
end
!
!-----------------------------------------------------------------------
function capital (character)
!---------------------------------------------------------------------
!
! converts character to capital if lowercase
! copy character to output in all other cases
!
implicit none
character*1 capital, character
!
character*26 minuscole, maiuscole
integer i
!
minuscole='abcdefghijklmnopqrstuvwxyz'
maiuscole='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
do i=1,26
if (character.eq.minuscole(i:i)) then
capital=maiuscole(i:i)
return
end if
end do
capital = character
!
return
end

View File

@ -147,8 +147,7 @@ subroutine scan_begin (iunps, string, rew)
character (len=80) :: rstring
! String read from file
integer :: ios
logical :: matches
external matches
logical, external :: matches
ios = 0
if (rew) rewind (iunps)
@ -171,8 +170,7 @@ subroutine scan_end (iunps, string)
! String read from file
character (len=80) :: rstring
integer :: ios
logical :: matches
external matches
logical, external :: matches
read (iunps, '(a)', iostat = ios, err = 300) rstring
if (matches ("</PP_"//string//">", rstring) ) return
@ -192,8 +190,7 @@ subroutine read_pseudo_header (is, iunps)
!
integer :: nv, ios, nw
character (len=75) :: dummy
logical :: matches
external matches
logical, external :: matches
read (iunps, *, err = 100, iostat = ios) nv, dummy
read (iunps, *, err = 100, iostat = ios) psd (is), dummy
@ -405,26 +402,3 @@ subroutine errore(a,b,n)
stop
end if
end subroutine errore
!
!-----------------------------------------------------------------------
logical function matches (string1, string2)
!-----------------------------------------------------------------------
!
implicit none
character (len=*) :: string1, string2
integer :: len1, len2, l
len1 = len_trim(string1)
len2 = len_trim(string2)
do l = 1, len2 - len1 + 1
if (string1 (1:len1) .eq.string2 (l:l + len1 - 1) ) then
matches = .true.
return
endif
enddo
matches = .false.
return
end function matches