\name{Consist_Trend}
\alias{Consist_Trend}
\title{
  Compute Trends
}
\description{
  Compute trends by least square fitting and the associated error interval for 
  both the observational and model data.
  Provide also the detrended observational and modelled data.
  The trend is computed along the start date dimension.
}
\usage{
  Consist_Trend(var_exp, var_obs, interval = 1)
}
\arguments{
  \item{var_exp}{
    Ensemble mean of model hindcasts with dimensions:
      c(nmod/nexp, nsdates, nltime) up to
      c(nmod/nexp, nsdates, nltime, nlevel, nlat, nlon)
  }
  \item{var_obs}{
    Ensemble mean of observational data with dimensions:
      c(nobs, nsdates, nltime) up to
      c(nobs, nsdates, nltime, nlevel, nlat, nlon)
  }
  \item{interval}{
    Number of months between 2 start dates. Default = 1.
  }
}
\value{
  \item{$trend}{
    Trends of model and observational data same dimensions with dimensions:
      c(nmod/nexp + nobs, 3, nltime) up to
      c(nmod/nexp + nobs, 3, nltime, nlevel, nlat, nlon)
    The length 3 dimension corresponds to the lower limit of the  95% confidence
     interval, the computed trends and the upper limit of the 95% confidence 
    interval.
  }
  \item{$detrendedmod}{
    Same dimensions as var_exp with linearly detrended var along the start date 
    dimension.
  }
  \item{$detrendedobs}{
    Same dimensions as var_exp with linearly detrended var along the start date 
    dimension.
  }
}
\author{
  History:
  1.0  -  2011-11  (V. Guemas, \email{vguemas@ic3.cat})  -  Original code
}
\keyword{datagen}
