def METHOD_NAME(config, env_var_name, config_name):
    """! If environment variable is set, use that value
     for the config variable and warn if the previous config value differs
     @param config METplusConfig object to read
     @param env_var_name name of environment variable to read
     @param config_name name of METplus config variable to check
    """
    env_var_value = os.environ.get(env_var_name, '')
    config_value = config.getdir_nocheck(config_name, '')
    # do nothing if environment variable is not set
    if not env_var_value:
        return
    # override config config variable to environment variable value
    config.set('config', config_name, env_var_value)
    # if config config value differed from environment variable value, warn
    if config_value == env_var_value:
        return
    config.logger.warning(f'Config variable {config_name} ({config_value}) '
                          'will be overridden by the environment variable '
                          f'{env_var_name} ({env_var_value})')