pcmdi_metrics.variability_mode.AMO
- pcmdi_metrics.variability_mode.AMO(model_ds, data_var='ts', seasons=['yearly'], reference_ds=None, method='eof', start_year=None, end_year=None, remove_domain_mean=True, land_mask=True, landfrac_ds=None, units_adjust=None, reference_units_adjust=None)[source]
Compute Atlantic Multidecadal Oscillation (AMO) diagnostics and metrics.
AMO is the leading EOF of sea surface temperature over the North Atlantic (0-70N, 80W-0E).
- Parameters:
model_ds (
xr.Dataset) – Model dataset containing sea surface temperature data.data_var (
str, optional) – Variable name in the dataset. Default is ‘ts’.seasons (
listofstr, optional) – List of seasons to compute. Default is [‘yearly’].reference_ds (
xr.Dataset, optional) – Reference/observational dataset for computing metrics. Default is None.method (
str, optional) – Method to use: ‘eof’ (default) or ‘cbf’ (requires reference_ds).start_year (
int, optional) – Start year for analysis. Default is None (use all data).end_year (
int, optional) – End year for analysis. Default is None (use all data).remove_domain_mean (
bool, optional) – If True (default), remove domain mean at each time step. This detrends the data by subtracting the spatial mean, focusing on spatial patterns.land_mask (
bool, optional) – If True, mask out land regions. Default is False.landfrac_ds (
xr.Dataset, optional) – Dataset containing land fraction (‘sftlf’). If land_mask is True but this is not provided, a land-sea mask will be generated automatically.units_adjust (
tuple, optional) – Unit conversion tuple: (enable, operation, value). Example: (True, ‘subtract’, -273.15) converts K to C. Operations: ‘multiply’, ‘divide’, ‘add’, ‘subtract’. Default is None (no conversion).reference_units_adjust (
tuple, optional) – Same as units_adjust but for reference dataset. Default is None.
- Returns:
dict– Results dictionary with structure: {- ’SEASON’: {
- ‘diagnostics’: {
‘eof_pattern’: xr.DataArray, # EOF spatial pattern ‘pc_timeseries’: xr.DataArray, # PC time series ‘frac’: float, # Variance fraction ‘stdv_pc’: float, # PC standard deviation ‘mean’: float, # Spatial mean (subdomain) ‘mean_glo’: float, # Spatial mean (global)
}, ‘metrics’: { # Only present if reference_ds provided
’cor’: float, # Spatial correlation (subdomain) ‘cor_glo’: float, # Correlation (global teleconnection) ‘rms’: float, # RMS error (subdomain) ‘rms_glo’: float, # RMS error (global teleconnection) ‘rmsc’: float, # Centered RMS (subdomain) ‘rmsc_glo’: float, # Centered RMS (global teleconnection) ‘bias’: float, # Bias (subdomain) ‘bias_glo’: float, # Bias (global teleconnection) ‘stdv_pc_ratio_to_obs’: float, # PC stdv ratio
}
}
}
Examples
>>> from pcmdi_metrics.variability_mode import AMO >>> results = AMO(model_ds, data_var='ts') >>> # AMO defaults to yearly analysis >>> print(results['yearly']['diagnostics']['frac'])
References
- Lee, J., K. Sperber, P. Gleckler, C. Bonfils, and K. Taylor, 2019:
Quantifying the Agreement Between Observed and Simulated Extratropical Modes of Interannual Variability. Climate Dynamics, 52, 4057-4089. https://doi.org/10.1007/s00382-018-4355-4