str_case.f90 Source File

Change the full string to particular case: upper or lower.


This file depends on

sourcefile~~str_case.f90~~EfferentGraph sourcefile~str_case.f90 str_case.f90 sourcefile~global.f90 global.f90 sourcefile~str_case.f90->sourcefile~global.f90

Files dependent on this one

sourcefile~~str_case.f90~~AfferentGraph sourcefile~str_case.f90 str_case.f90 sourcefile~check_outout_control.f90 check_outout_control.f90 sourcefile~check_outout_control.f90->sourcefile~str_case.f90 sourcefile~read_output.f90 read_output.f90 sourcefile~read_output.f90->sourcefile~check_outout_control.f90 sourcefile~state.f90 state.f90 sourcefile~state.f90->sourcefile~check_outout_control.f90 sourcefile~state.f90->sourcefile~read_output.f90 sourcefile~create_and_erase.f90 create_and_erase.f90 sourcefile~create_and_erase.f90->sourcefile~state.f90 sourcefile~solver.f90 solver.f90 sourcefile~solver.f90->sourcefile~state.f90 sourcefile~main.f90 main.f90 sourcefile~main.f90->sourcefile~solver.f90 sourcefile~start_finish.f90 start_finish.f90 sourcefile~main.f90->sourcefile~start_finish.f90 sourcefile~start_finish.f90->sourcefile~solver.f90

Contents

Source Code


Source Code

  !< Change the full string to particular case: upper or lower.
module str_case
  !< Change the full string to particular case: upper or lower.
  use global, only: STRING_BUFFER_LENGTH
  implicit none
  private
  
  character(len=STRING_BUFFER_LENGTH) :: res
  public :: ucase
  public :: lcase
  
  contains

    function ucase(text) result(res)
      !<Mmake the whole string to upper case
      CHARACTER(len=*), intent(in)        :: text
      !< Input string of any case
      character(len=STRING_BUFFER_LENGTH) :: res
      !< Output string of upper case
      integer ::  I,C
  
      res=text
      DO I = 1,LEN(TEXT)
        C = INDEX("abcdefghijklmnopqrstuvwxyz",TEXT(I:I))
        IF (C.GT.0) res(I:I) = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"(C:C)
      END DO
  
    end function ucase

    function lcase(text) result(res)
      !< Make the whole string to lower case
      CHARACTER(len=*), intent(in)         :: text
      !< Input string of any case
      character(len=STRING_BUFFER_LENGTH) :: res
      !< Output string of lower case
      integer ::  I,C
  
      res=text
      DO I = 1,LEN(TEXT)
        C = INDEX("ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT(I:I))
        IF (C.GT.0) res(I:I) = "abcdefghijklmnopqrstuvwxyz"(C:C)
      END DO
  
    end function lcase

end module str_case