hydromt_wflow.WflowModel.write_forcing#
- WflowModel.write_forcing(filename: str | None = None, output_frequency: str | None = None, time_chunk: int = 1, time_units='days since 1900-01-01T00:00:00', decimals: int = 2, overwrite: bool = False, **kwargs)[source]#
Write forcing at <root/dir_input/filename> in model ready format.
If no ``filename` path is provided and path_forcing from the wflow toml exists, the following default filenames are used:
Default name format (with downscaling): inmaps_sourcePd_sourceTd_methodPET_freq_startyear_endyear.nc
Default name format (no downscaling): inmaps_sourceP_sourceT_methodPET_freq_startyear_endyear.nc
- Parameters:
filename (Path | str, optional) – Path to save output netcdf file; if None the name is read from the wflow toml file.
output_frequency (str (Offset), optional) – Write several files for the forcing according to output_frequency. For example ‘Y’ for one file per year or ‘M’ for one file per month. By default writes the one file. For more options, see https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases
time_chunk (int, optional) – Chunksize on time dimension when saving to disk. By default 1.
time_units (str, optional) – Common time units when writing several netcdf forcing files. By default “days since 1900-01-01T00:00:00”.
decimals (int, optional) – Number of decimals to use when writing the forcing data. By default 2.
overwrite (bool, optional) – Whether to overwrite existing files. By default False.
**kwargs (dict) – Additional keyword arguments to be passed to the write_nc method.