import re


def read_model_from_config_file( \
    config_file):
    """Read model from config file"""

    model = None

    # read lines from config file
    with open(config_file) as _f:
        for line in _f:
            # parse model, if line matches model
            model_match = re.search(r'^(;|#)\s+Model:\s+(A\d+)', line, re.I)
            if model_match:
                model = model_match.group(2)
                break
    
    return model