The page document the user-supplied call-back routine init_ens_pdaf.

The routine init_ens_pdaf (called U_init_ens in the PDAF core routines) is a call-back routine that has to be provided by the user. init_ens_pdaf is called by PDAF_init at the initialization stage of a data assimilation program. The purpose of the routine is to fill the ensemble array that is provided by PDAF with an initial ensemble of model states.

The interface is the following:

SUBROUTINE init_ens_pdaf(filtertype, dim_p, dim_ens, &
                           state_p, Uinv, ens_p, flag)


  • filtertype : integer, intent(in)
    The integer defining the type of filter algorithm as given in the call to PDAF_init
  • dim_p : integer, intent(in)
    An integer holding the size of the state dimension for the calling process as specified in the call to PDAF_init
  • dim_ens : integer, intent(in)
    An integer holding the size of the ensemble (or the rank of the state covariance matrix for SEEK)
  • state_p : real, intent(inout), dimension(dim_p)
    A real array for the model state part of the calling process (Only relevant for mode-based filters like SEEK; does not need to be filled for ensemble-based filters)
  • Uinv : real, intent(inout), dimension(dim_ens-1, dim_ens-1)
    A real array for the inverse of matrix U from the decomposition of the state error covariance matrix P = VUVT (Only relevant for mode-based filters like SEEK.)
  • ens_p : real, intent(out), dimension(dim_p, dim_ens)
    A real array that has tobe filled with the ensemble of model states. (In case of a mode-based filter (SEEK), the array has to be fillex with the modes of the covariance matrix)
  • flag : integer, intent(inout)
    Status flag for PDAF. It is 0 upon entry and can be set by in the user-supplied routine, depending on the success of the ensemble initialization. Preferably, values above 102 should be used for failures to avoid conflicts with the error codes defined within PDAF_init.


  • The routine is called by all MPI processes that compute the filter analysis step (i.e. those for which 'filterpe' is set to true. In the standard configuration of init_parallel_pdaf these are all processes of the first model task, i.e. task_id=1.)
  • init_ens_pdaf is only called by PDAF_init if no error occurred before; thus the status flag is zero.
Last modified 9 years ago Last modified on Jan 19, 2015, 9:08:23 AM