def ERA2Model(data, lon_name='longitude', lat_name='latitude'):
    """
		Invert the direction of latitude, and swap longitude domain
		 from -180,180 to 0,360.
		 Assumes an xr.DataArray or xr.Dataset.

		INPUTS:
			data:      xarray.DataArray or xarray.Dataset to regrid
			lon_name:  name of longitude dimension. Set to None if nothing should be done.
			lat_name:  name of latitude dimension. Set to None if nothing should be done.
		OUTPUTS:
			data:     xarray.DataArray with latitude swapped and
					   longitude from 0 to 360 degrees.
	"""
    if lat_name is not None:
        data = data.interp({lat_name: data[lat_name][::-1]}, method='nearest')
    if lon_name is not None:
        data_low = data.sel({lon_name: slice(0, 180)})
        data_neg = data.sel({lon_name: slice(-180, -0.001)})
        data_neg[lon_name] += 360
    return data.sortby(lon_name)
