def _ctypes_saved(parameter):
    """Returns local variable declarations that create allocatable variables that can persist
    long enough to return their value through ctypes.
    """
    if ("out" in parameter.direction and parameter.dimension is not None and
        ":" in parameter.dimension and ("allocatable" in parameter.modifiers or
                                        "pointer" in parameter.modifiers)):
        stype = _ctypes_dtype(parameter)
        name = "{}_t({})".format(parameter.name, parameter.dimension)
        return ("{}, allocatable, target, save :: {}".format(stype, name), True)