pygetm.output.netcdf module
- class pygetm.output.netcdf.NetCDFFile(available_fields: Mapping[str, Array], logger: Logger, path: PathLike[str] | str, rank: int, sync_interval: int | None = 1, time_reference: datetime | None = None, format: str = 'NETCDF4', compression: str | None = None, **kwargs)[source]
Bases:
FileCreate a NetCDF file for output
- Parameters:
available_fields – collection of model fields that may be added
logger – target for log messages
path – file to create. If it exists it will be clobbered.
rank – rank of this subdomain. This will be used to determine whether we are the root (rank 0) all output is gathered and written to a single file. Otherwise the rank will be used as suffix for the subdomain-specific files.
sync_interval – frequency to call NetCDF sync, which forces all output to be written to disk. If set to None, synchronization will happen only when the file is closed as the end of a simulation.
time_reference – time reference (epoch) to use as offset for the time coordinate.
format – underlying file format (see
netCDF4.Datasetdocumentation)compression – compression algorithm to apply to all variables (see
netCDF4.Dataset.createVariable()documentation)**kwargs – additional keyword arguments passed to
pygetm.output.File