# `download_nc()`
**Category:** Connection and acquisition
**Status:** stable

## Purpose
Download a Copernicus product through the configured client.

## 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
download_nc(dataset_id, vars, lon = NULL, lat = NULL, time = NULL,      depth = NULL, outdir = ".", fmt = c("netcdf", "zarr", "csv",          "parquet"), overwrite = FALSE, skip_existing = TRUE,      dry_run = FALSE, filename = NULL, verbose = TRUE)
```

## Arguments
- `dataset_id`: see the installed Rd manual for validation and defaults.
- `vars`: see the installed Rd manual for validation and defaults.
- `lon`: see the installed Rd manual for validation and defaults.
- `lat`: see the installed Rd manual for validation and defaults.
- `time`: see the installed Rd manual for validation and defaults.
- `depth`: see the installed Rd manual for validation and defaults.
- `outdir`: see the installed Rd manual for validation and defaults.
- `fmt`: see the installed Rd manual for validation and defaults.
- `overwrite`: see the installed Rd manual for validation and defaults.
- `skip_existing`: see the installed Rd manual for validation and defaults.
- `dry_run`: see the installed Rd manual for validation and defaults.
- `filename`: see the installed Rd manual for validation and defaults.
- `verbose`: see the installed Rd manual for validation and defaults.

## Input and output
Input: **request**. Output: **file(s)**.

## Backend support
Memory: **FALSE**. NetCDF: **FALSE**. Backend operations retain read-only semantics; materialisation is explicit.

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

## Metadata
Units, coordinates, provenance, masks, and QA metadata are retained or reported where meaningful.

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

## Example in a workflow
Typical position: `cm_connect` → `download_nc()` → `read_nc`. 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: `cm_connect`. Next: `read_nc`.
