Double precision float in Fortran file will have form 'x.ydz' or 'x.yDz', this cannot be convert directly to float
    by Python ``float`` function, so I wrote this function to help conversion. For example,

    :param s: a string denoting a double precision number
    :return: a Python floating point number

    .. doctest::

        >>> string_to_double_precision_float('1d-82')
        1e-82
        >>> string_to_double_precision_float('1.0D-82')
        1e-82
        >>> string_to_double_precision_float('0.8D234')
        8e+233
        >>> string_to_double_precision_float('.8d234')
        8e+233

def string_to_double_precision_float(s: str) -> float:
    """
    Double precision float in Fortran file will have form 'x.ydz' or 'x.yDz', this cannot be convert directly to float
    by Python ``float`` function, so I wrote this function to help conversion. For example,

    :param s: a string denoting a double precision number
    :return: a Python floating point number

    .. doctest::

        >>> string_to_double_precision_float('1d-82')
        1e-82
        >>> string_to_double_precision_float('1.0D-82')
        1e-82
        >>> string_to_double_precision_float('0.8D234')
        8e+233
        >>> string_to_double_precision_float('.8d234')
        8e+233
    """
    first, second, exponential = re.match(
        "(-?\d*)\.?(-?\d*)d(-?\d+)", s, re.IGNORECASE).groups()
    return float(first + '.' + second + 'e' + exponential)