replace_string_char Function

public function replace_string_char(replace_str, match_str, read_str)

Arguments

Type IntentOptional Attributes Name
character(len=*) :: replace_str
character(len=*) :: match_str
character(len=*) :: read_str

Return Value character(len=256)


Called by

proc~~replace_string_char~~CalledByGraph proc~replace_string_char replace_string_char proc~uemep_read_config uEMEP_read_config proc~uemep_read_config->proc~replace_string_char proc~uemep_read_meteo_nc uEMEP_read_meteo_nc proc~uemep_read_meteo_nc->proc~replace_string_char proc~uemep_calculate_emissions_for_emep uEMEP_calculate_emissions_for_EMEP proc~uemep_calculate_emissions_for_emep->proc~uemep_read_meteo_nc program~uemep uEMEP program~uemep->proc~uemep_read_config program~uemep->proc~uemep_read_meteo_nc program~uemep->proc~uemep_calculate_emissions_for_emep

Source Code

    function replace_string_char(replace_str,match_str,read_str)
        !Finds a match_str in read_str and replaces it with replace_str to give a new version of read_str
        implicit none

        character(256) replace_string_char
        character (*) match_str,replace_str,read_str
        character(256) temp_str1,temp_str2
        integer index_start,index_stop

        replace_string_char=read_str

        index_start=index(read_str,trim(match_str))
        if (index_start.ne.0) then
            index_stop=index_start+len(trim(match_str))
            temp_str1=read_str(1:index_start-1)
            temp_str2=read_str(index_stop:len(read_str))
            replace_string_char=trim(temp_str1)//trim(replace_str)//trim(temp_str2)
        endif
        !write(*,'(A)') trim(replace_string_char)

    end function replace_string_char