str_to_lower Function

public function str_to_lower(s)

Convert string in input from upper case to lower case and return the lower case string as output.

Arguments

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

String to be converted in lowercase

Return Value character

String converted to lowercase


Called by

proc~~str_to_lower~~CalledByGraph proc~str_to_lower str_to_lower proc~check_keyword check_keyword proc~check_keyword->proc~str_to_lower proc~init_eel_for_link_atom init_eel_for_link_atom proc~init_eel_for_link_atom->proc~str_to_lower proc~init_bonded_for_link_atom init_bonded_for_link_atom proc~init_bonded_for_link_atom->proc~str_to_lower proc~check_keyword~2 check_keyword proc~check_keyword~2->proc~str_to_lower proc~mmpol_init_from_xyz mmpol_init_from_xyz proc~mmpol_init_from_xyz->proc~str_to_lower proc~mmpol_init_from_xyz->proc~check_keyword~2 proc~qm_helper_init_vdw_prm qm_helper_init_vdw_prm proc~qm_helper_init_vdw_prm->proc~str_to_lower proc~ommp_system_from_qm_helper ommp_system_from_qm_helper proc~ommp_system_from_qm_helper->proc~str_to_lower proc~ommp_system_from_qm_helper->proc~check_keyword~2 proc~ommp_create_link_atom ommp_create_link_atom proc~ommp_create_link_atom->proc~init_eel_for_link_atom proc~ommp_create_link_atom->proc~init_bonded_for_link_atom proc~ommp_create_link_atom->proc~qm_helper_init_vdw_prm proc~c_ommp_system_from_qm_helper C_ommp_system_from_qm_helper proc~c_ommp_system_from_qm_helper->proc~ommp_system_from_qm_helper proc~c_ommp_qm_helper_init_vdw_prm C_ommp_qm_helper_init_vdw_prm proc~c_ommp_qm_helper_init_vdw_prm->proc~qm_helper_init_vdw_prm proc~ommp_init_xyz ommp_init_xyz proc~ommp_init_xyz->proc~mmpol_init_from_xyz proc~c_ommp_create_link_atom C_ommp_create_link_atom proc~c_ommp_create_link_atom->proc~ommp_create_link_atom proc~c_ommp_init_xyz C_ommp_init_xyz proc~c_ommp_init_xyz->proc~ommp_init_xyz

Contents

Source Code


Source Code

    function str_to_lower(s)
        !! Convert string in input from upper case to lower case and return
        !! the lower case string as output.

        implicit none

        character(len=*), intent(in) :: s
        !! String to be converted in lowercase
        character(len(s)) :: str_to_lower
        !! String converted to lowercase

        integer :: ic, i

        character(26), parameter :: capital = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
        character(26), parameter :: lower = 'abcdefghijklmnopqrstuvwxyz'

        str_to_lower = s
        do i=1, len_trim(s)
            ic = index(capital, s(i:i))
            if(ic > 0) str_to_lower(i:i) = lower(ic:ic)
        end do
        
        return

    end function str_to_lower