lowercase Function

public pure function lowercase(text) result(out)

Converts an input string to all lowercase characters.

Useful for normalizing namelist inputs and performing case-insensitive comparison of species names or boundary conditions.

Arguments

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

The source string to convert.

Return Value character(len=len)


Called by

proc~~lowercase~~CalledByGraph proc~lowercase mod_kinds::lowercase proc~build_bc_set mod_bc::build_bc_set proc~build_bc_set->proc~lowercase proc~parse_bc_type mod_bc::parse_bc_type proc~build_bc_set->proc~parse_bc_type proc~initialize_species mod_species::initialize_species proc~initialize_species->proc~lowercase proc~parse_bc_type->proc~lowercase proc~read_boundary_input mod_input::read_boundary_input proc~read_boundary_input->proc~lowercase proc~read_profiling_input mod_input::read_profiling_input proc~read_profiling_input->proc~lowercase proc~read_solver_input mod_input::read_solver_input proc~read_solver_input->proc~lowercase proc~read_case_params mod_input::read_case_params proc~read_case_params->proc~read_boundary_input proc~read_case_params->proc~read_profiling_input proc~read_case_params->proc~read_solver_input program~lowmach_react_hex lowmach_react_hex program~lowmach_react_hex->proc~build_bc_set program~lowmach_react_hex->proc~initialize_species program~lowmach_react_hex->proc~read_case_params

Source Code

   pure function lowercase(text) result(out)
      character(len=*), intent(in) :: text
      character(len=len(text)) :: out

      integer :: i
      integer :: code

      do i = 1, len(text)
         code = iachar(text(i:i))
         if (code >= iachar('A') .and. code <= iachar('Z')) then
            out(i:i) = achar(code + iachar('a') - iachar('A'))
         else
            out(i:i) = text(i:i)
         end if
      end do
   end function lowercase