EuroAtlanticTC <- function(anom, lat, lon, ntrunc = 30) {
  # A preset region for computing EuroAtlantic teleconnections
  lat.min <- 20
  lat.max <- 80
  lon.min <- -90 # Write this as a negative number please!
  lon.max <- 60

  # Chose lats and lons inside the Euroatlantic region. 
  # build a lon2 copy only for subsetting purposes
  lon2 <- ifelse(lon < 180,lon,lon-360)
  idx_lat <- which(lat >= lat.min & lat <= lat.max)
  idx_lon <- which(lon2 >= lon.min & lon2 <= lon.max)

  # Subset 
  lat.s <- lat[idx_lat]
  lon.s <- lon[idx_lon]
  lon2.s <- lon2[idx_lon]
  anom.s <- anom[,idx_lat,idx_lon]

  # Make sure whole EuroAtlantic region is covered
  # Allow for 5 degrees of margin
  if (lat.max-max(lat.s)>5) stop("The provided data does not covers the EuroAtlantic region")
  if (min(lat.s)-lat.min>5) stop("The provided data does not covers the EuroAtlantic region")
  if (lon.max-max(lon2.s)>5) {
    stop("The provided data does not covers the EuroAtlantic region")
  }
  if (min(lon2.s)-lon.min>5) stop("The provided data does not covers the EuroAtlantic region")
  
  # Compute rotated EOFs, return the first four TC (typically NAO, EA, EA/WR & SCAN)
  reofs <- REOF(anom.s,lat.s,lon.s,ntrunc)
  TCP <- Subset(reofs$REOFs, 'reofs', 1:4, drop = FALSE)
  TCI <- Subset(reofs$RPCs, 'reofs', 1:4, drop = FALSE)

  return(list(patterns = TCP, indices = TCI))
}
