def fortran_int(s, blank_value = 0):
    """Returns float of a string written by Fortran.
    Its behaviour is different from the float() function in the following ways:
    - a blank string will return the specified blank value (default zero)
    - embedded spaces are ignored
    If any other errors are encountered, None is returned."""
    try: return int(s)
    except ValueError:
        s = s.strip()
        if not s: return blank_value
        else:
            try:
              s = s.replace(' ', '')
              return int(s)
            except: return None