lower Function

private function lower(s1) result(s2)

Converts uppercase to lowercase, adapted from here

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: s1

string to transform to lower case

Return Value character(len=len(s1))

result: same string but each character is lower case


Called by

proc~~lower~~CalledByGraph proc~lower lower proc~read_surf~2 read_surf proc~read_surf~2->proc~lower proc~write_surf write_surf proc~write_surf->proc~lower program~test_surfile test_surfile program~test_surfile->proc~read_surf~2 program~test_surfile->proc~write_surf

Source Code

   function lower(s1) result (s2)
   !! Converts uppercase to lowercase, adapted from [here](http://fortranwiki.org/fortran/show/String_Functions)
   character(*), intent(in) :: s1   !! *string to transform to lower case*
   character(len(s1))  :: s2        !! *result: same string but each character is lower case*

      character(len=1) :: ch
      integer(kind=I4), parameter :: duc = ichar('A') - ichar('a')
      integer(kind=I4) :: i

      do i = 1, len(s1)
         ch = s1(i:i)
         if (ch >= 'A'.and.ch <= 'Z') ch = char(ichar(ch)-duc)
         s2(i:i) = ch
      enddo

   return
   endfunction lower