pyPDAF.PDAF.init¶
- pyPDAF.PDAF.init(filtertype: int, subtype: int, stepnull: int, param_int: NDArray[np.int32], dim_pint: int, param_real: NDArray[np.float64], dim_preal: int, comm_model: int, comm_filter: int, comm_couple: int, task_id: int, n_modeltasks: int, in_filterpe: bool, py__init_ens_pdaf: Callable[..., Any], in_screen: int) Tuple[NDArray[np.int32], NDArray[np.float64], int]¶
Initialise the PDAF system.
It is called once at the beginning of the assimilation.
The function specifies the type of DA methods, parameters of the filters, the MPI communicators, and other parallel options. The filter options including filtertype, subtype, param_int, and param_real are introduced in PDAF filter options wiki page. Note that the size of param_int and param_real depends on the filter type and subtype. However, for most filters, they require at least the state vector size and ensemble size for param_int, and the forgetting factor for param_real.
The MPI communicators asked by this function depends on the parallelisation strategy. For the default parallelisation strategy, the user can use the parallelisation module provided under in example directory without modifications. The parallelisation can differ based on online and offline cases. Users can also refer to parallelisation documentation for explanations or modifications.
This function also asks for a user-supplied function
py__init_ens_pdaf(). This function is designed to provides an initial ensemble to the internal PDAF ensemble array. The internal PDAF ensemble then can be distributed to initialise the model forecast usingpyPDAF.PDAF.get_state(). This user-supplied function can be empty if the model has already read the ensemble from restart files.- Parameters:
filtertype (int) – Type of filter
subtype (int) – Sub-type of filter
stepnull (int) – Initial time step of assimilation
param_int (ndarray[np.intc, ndim=1]) – Integer parameter array Array shape: (dim_pint)
dim_pint (int) – Number of integer parameters
param_real (ndarray[np.float64, ndim=1]) – Real parameter array Array shape: (dim_preal)
dim_preal (int) – Number of real parameter
comm_model (int) – Model communicator
comm_filter (int) – Filter communicator
comm_couple (int) – Coupling communicator
task_id (int) – Id of my ensemble task
n_modeltasks (int) – Number of parallel model tasks
in_filterpe (bint) – Is my PE a filter-PE?
py__init_ens_pdaf (Callable) – Initialise ensemble array in PDAF
in_screen (int) – Control screen output:
- Returns:
param_int (ndarray[np.intc, ndim=1]) – Integer parameter array Array shape: (dim_pint)
param_real (ndarray[np.float64, ndim=1]) – Real parameter array Array shape: (dim_preal)
outflag (int) – Status flag, 0: no error, error codes: