str_uncomment Function

public function str_uncomment(s, comment_char)

Remove inline comments from a srting s, comments should begin with the string or character contained in comment_char

Arguments

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

String in input

character(len=*), intent(in) :: comment_char

Char that begin the comment

Return Value character

String converted to lowercase


Called by

proc~~str_uncomment~~CalledByGraph proc~str_uncomment str_uncomment proc~init_eel_for_link_atom init_eel_for_link_atom proc~init_eel_for_link_atom->proc~str_uncomment proc~mmpol_init_from_xyz mmpol_init_from_xyz proc~mmpol_init_from_xyz->proc~str_uncomment proc~ommp_system_from_qm_helper ommp_system_from_qm_helper proc~ommp_system_from_qm_helper->proc~str_uncomment proc~init_bonded_for_link_atom init_bonded_for_link_atom proc~init_bonded_for_link_atom->proc~str_uncomment proc~qm_helper_init_vdw_prm qm_helper_init_vdw_prm proc~qm_helper_init_vdw_prm->proc~str_uncomment 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_uncomment(s, comment_char)
        !! Remove inline comments from a srting s, comments should
        !! begin with the string or character contained in comment_char

        implicit none

        character(len=*), intent(in) :: s
        !! String in input
        character(len=*), intent(in) :: comment_char
        !! Char that begin the comment
        character(len(s)) :: str_uncomment
        !! String converted to lowercase

        integer(ip) :: idx

        str_uncomment = ' '

        idx = index(s, comment_char)
        if(idx > 0) then
            str_uncomment(1:idx-1) = s(1:idx-1)
        else
            str_uncomment = s
        end if

    end function str_uncomment