hydromt_wflow.WflowBaseModel.write_forcing#

WflowBaseModel.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:

  • With downscaling: inmaps_sourcePd_sourceTd_methodPET_freq_startyear_endyear.nc

  • Without downscaling: inmaps_sourceP_sourceT_methodPET_freq_startyear_endyear.nc

Parameters:
  • filename (Path or str, optional) – Path to save output NetCDF file. If None, the name is read from the wflow.toml file.

  • output_frequency (str, optional) – Write several files for the forcing according to frequency. For example 'Y' for one file per year or 'M' for one file per month. By default writes a single file. For more options see: https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases

  • time_chunk (int, optional) – Chunk size on the time dimension when saving to disk. Default is 1.

  • time_units (str, optional) – Common time units when writing several NetCDF forcing files. Default is "days since 1900-01-01T00:00:00".

  • decimals (int, optional) – Number of decimals to use when writing the forcing data. Default is 2.

  • overwrite (bool, optional) – Whether to overwrite existing files. Default is False.

  • **kwargs (dict) – Additional keyword arguments passed to write_nc.