# `anom_z()`
**Category:** Time and climatology
**Status:** stable

## Purpose
Compute standardized anomalies through the canonical `cube_anomaly()` engine
from a compatible legacy climatology object.

## When to use
Use it when its declared input and output match the workflow. Prefer a narrower selection before any operation that may materialise values.

## When not to use
Do not use it to calculate `spatind` indicators or to bypass coordinate, CRS, unit, and provenance checks.

## Real signature
```r
anom_z(x, clim)
```

## Arguments
- `x`: see the installed Rd manual for validation and defaults.
- `clim`: see the installed Rd manual for validation and defaults.

## Input and output
Input: **ocean_cube**. Output: **ocean_cube**.

## Backend support
Memory: **TRUE**. NetCDF: **TRUE**. Lazy sources use bounded reads and the
result is materialised in memory.

## Dimensional effect
Preserves the relevant cube contract or returns metadata/geometry without silently dropping axes.

## Metadata
The result has unit `"1"`; canonical anomaly provenance and QA are reported.
Historical climatologies without canonical metadata must be recomputed.

## Minimal executable check
```r
library(oceancube)
stopifnot(is.function(oceancube::anom_z))
names(formals(oceancube::anom_z))
```

## Example in a workflow
Typical position: `clim_day/clim_month` → `anom_z()` → `signal_noise`. See the workflow scripts for a checked end-to-end example.

## Frequent errors and limitations
Invalid dimensions, selectors, units, CRS, source-file identity, optional dependencies, or unsupported grids are rejected explicitly. Read the function Rd page for exact diagnostics.

## Related functions
Previous: `clim_day/clim_month`. Next: `signal_noise`.
