def _format_value(value):
    """ Format a value into fortran's namelist format (return a string)
    """
    if isinstance(value, bool):
        return value and '.true.' or '.false.'
    else:
        return "{}".format(repr(value))