Self-organized criticality in 1D traffic flow model with inflow or outflow