pycoupler.read_config#

pycoupler.read_config(file_name, model_path=None, spin_up=False, macros=None, to_dict=False)[source]#

Read LPJmL configuration files and return as LpjmlConfig object or dict.

Parameters:
  • file_name (str) – File name (including relative/absolute path) of the LPJmL configuration.

  • model_path (str, optional) – Path to model root directory. If provided, joined with file_name.

  • spin_up (bool, default False) – Convenience argument to set macro whether to start from restart file (True) or not (False).

  • macros (str or list, optional) – Macro(s) to provide in the form of “-DMACRO” or list of macros.

  • to_dict (bool, default False) – If True, a dictionary is returned. If False, an LpjmlConfig object is returned.

Returns:

LpjmlConfig object (if to_dict=False) or dictionary (if to_dict=True).

Return type:

LpjmlConfig or dict