def _fortran_to_val(val):
    """
    Transform a Fortran value to a Python one.

    Args:
        val (str): The value to translate.

    Returns:
        A Python representation.

    """
    if val[0] == val[-1] == '"':
        return val[1:-1]
    if val == '.true.':
        return True
    if val == '.false.':
        return False
    try:
        return int(val)
    except ValueError:
        pass
    val = val.replace('d', 'e').replace('D', 'e')
    try:
        return float(val)
    except ValueError:
        pass
    raise TypeError('Unable to parse: ' + val)
