% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/GSAT.R
\name{GSAT}
\alias{GSAT}
\title{Compute the Global Surface Air Temperature (GSAT) anomalies}
\usage{
GSAT(data, data_lats, data_lons, type, lat_dim = "lat", lon_dim = "lon",
  mask = NULL, monini = 11, fmonth_dim = "fmonth", sdate_dim = "sdate",
  indices_for_clim = NULL, year_dim = "year", month_dim = "month",
  member_dim = "member")
}
\arguments{
\item{data}{Data to be used for the index computation with latitude, longitude, start date, forecast month, and member dimensions (in case of decadal predictions),
with latitude, longitude, year, month and member dimensions (in case of historical simulations), or with latitude, longitude, year and month (in case of observations or reanalyses).
This data has to be provided, at least, over the whole region needed to compute the index.}

\item{data_lats}{An array with the latitudes of the data.}

\item{data_lons}{An array with the longitudes of the data.}

\item{type}{A string the the type of data ('dcpp' for decadal predictions, 'hist' for historical simulations, or 'obs' for observations or reanalyses).}

\item{lat_dim}{A string with the name of the latitude dimension ('lat' by default).}

\item{lon_dim}{A string with the name of the longitude dimension ('lon' by default).}

\item{mask}{An array with a mask (with 0's in the grid points that have to be masked) or NULL (NULL by default, i.e., no mask is used). This parameter allows to remove the values over land in case the dataset is a 
combination of surface air temperature over land and sea surface temperature over the ocean. Also, it can be used to mask those grid points that are missing in the 
observational dataset for a fair comparison between the forecast system and the reference dataset.}

\item{monini}{Month in which the forecast system is initialized (11 by default, i.e., initialized in November). Only used if type='dcpp'.}

\item{fmonth_dim}{A string with the name of the forecast month dimension ('fmonth' by default). Only used if type='dcpp'.}

\item{sdate_dim}{A string with the name of the start date dimension ('sdate' by default). Only used if type='dcpp'.}

\item{indices_for_clim}{Indices of the years to compute the climatology. If NULL, the climatology is calculated over the whole period (NULL by default).
In case of type='dcpp', indices_for_clim must be relative to the first forecast year, and the climatology is automatically computed over the actual common period for the different forecast years.}

\item{year_dim}{A string with the name of the year dimension ('year' by default). Only used if type='hist' or type='obs'.}

\item{month_dim}{A string with the name of the month dimension ('month' by default). Only used if type='hist' or type='obs'.}

\item{member_dim}{A string with the name of the member dimension ('member' by default). Only used if type='dcpp' or type='hist'.}
}
\value{
The GSAT anomalies as function of the sdate, forecast year, and member (in case of decadal predictions);
 as function of the year and the member (in case of historical simulations); or as function of the year (in case of observations or reanalyses).
}
\description{
The Global Surface Air Temperature (GSAT) anomalies are computed as the 
weighted-averaged surface air temperature anomalies over the global region.
}
\examples{
## Observations or reanalyses
obs = array(1:100, dim = c(year = 5, lat = 19, lon = 37, month = 12))
lat = seq(-90, 90, 10)
lon = seq(0, 360, 10)
index_obs = GSAT(data = obs, data_lats = lat, data_lons = lon, type = 'obs')

## Historical simulations
hist = array(1:100, dim = c(year = 5, lat = 19, lon = 37, month = 12, member = 5))
lat = seq(-90, 90, 10)
lon = seq(0, 360, 10)
index_hist = GSAT(data = hist, data_lats = lat, data_lons = lon, type = 'hist')

## Decadal predictions
dcpp = array(1:100, dim = c(sdate = 5, lat = 19, lon = 37, fmonth = 24, member = 5))
lat = seq(-90, 90, 10)
lon = seq(0, 360, 10)
index_dcpp = GSAT(data = dcpp, data_lats = lat, data_lons = lon, type = 'dcpp', monini = 1)

}
\author{
Carlos Delgado-Torres, \email{carlos.delgado@bsc.es}

Núria Pérez-Zanón, \email{nuria.perez@bsc.es}

Roberto Bilbao, \email{roberto.bilbao@bsc.es}
}

