pyPDAF.PDAF.localomi_put_state_hyb3dvar_lestkf

pyPDAF.PDAF.localomi_put_state_hyb3dvar_lestkf()

Hybrid 3DEnVar for a single DA step using diagnoal observation error covariance matrix without post-processing, distributing analysis, and setting next observation step.

Here, the background error covariance is hybridised by a static background error covariance, and a flow-dependent background error covariance estimated from ensemble.

Compared to pyPDAF.PDAF.localomi_assimilate_hyb3dvar_lestkf(), this function has no get_state() call. This means that the analysis is not post-processed, and distributed to the model forecast by user-supplied functions. The next DA step will not be assigned by user-supplied functions as well. This function is typically used when there are not enough CPUs to run the ensemble in parallel, and some ensemble members have to be run serially. The pyPDAF.PDAF.get_state() function follows this function call to ensure the sequential DA.

The 3DVar generates an ensemble mean and the ensemble perturbation is generated by LESTKF in this implementation. This function should be called at each model time step.

The user-supplied functions are executed in the following sequence:
  1. py__collect_state_pdaf

  2. py__prepoststep_state_pdaf

  3. py__init_dim_obs_pdaf

  4. py__obs_op_pdaf

  5. The iterative optimisation:
    1. py__cvt_pdaf

    2. py__cvt_ens_pdaf

    3. py__obs_op_lin_pdaf

    4. py__obs_op_adj_pdaf

    5. py__cvt_adj_pdaf

    6. py__cvt_adj_ens_pdaf

    7. core DA algorithm

  6. py__cvt_pdaf

  7. py__cvt_ens_pdaf

  8. Perform LESTKF:
    1. py__init_n_domains_p_pdaf

    2. py__init_dim_obs_pdaf

    3. py__obs_op_pdaf (for each ensemble member)

    4. loop over each local domain:
      1. py__init_dim_l_pdaf

      2. py__init_dim_obs_l_pdaf

      3. core DA algorithm

Parameters:
  • py__collect_state_pdaf (Callable[dim_p:int, state_p : ndarray[tuple[dim_p], np.float64]]) –

    Routine to collect a state vector

    Callback Parameters
    • dim_pint
      • pe-local state dimension

    • state_pndarray[tuple[dim_p], np.float64]
      • local state vector

    Callback Returns
    • state_pndarray[tuple[dim_p], np.float64]
      • local state vector

  • py__init_dim_obs_pdaf (Callable[step:int, dim_obs_p:int]) –

    Initialize dimension of full observation vector

    Callback Parameters
    • stepint
      • current time step

    • dim_obs_pint
      • dimension of observation vector

    Callback Returns
    • dim_obs_pint
      • dimension of observation vector

  • py__obs_op_pdaf (Callable[step:int, dim_p:int, dim_obs_p:int, state_p : ndarray[tuple[dim_p], np.float64], m_state_p : ndarray[tuple[dim_obs_p], np.float64]]) –

    Full observation operator

    Callback Parameters
    • stepint
      • Current time step

    • dim_pint
      • Size of state vector (local part in case of parallel decomposed state)

    • dim_obs_pint
      • Size of observation vector

    • state_pndarray[tuple[dim_p], np.float64]
      • Model state vector

    • m_state_pndarray[tuple[dim_obs_p], np.float64]
      • Observed state vector (i.e. the result after applying the observation operator to state_p)

    Callback Returns
    • m_state_pndarray[tuple[dim_obs_p], np.float64]
      • Observed state vector (i.e. the result after applying the observation operator to state_p)

  • py__cvt_ens_pdaf (Callable[iter:int, dim_p:int, dim_ens:int, dim_cvec_ens:int, ens_p : ndarray[tuple[dim_p, dim_ens], np.float64], v_p : ndarray[tuple[dim_cvec_ens], np.float64], Vv_p : ndarray[tuple[dim_p], np.float64]]) –

    Apply control vector transform matrix to control vector

    Callback Parameters
    • iterint
      • Iteration of optimization

    • dim_pint
      • PE-local dimension of state

    • dim_ensint
      • Ensemble size

    • dim_cvec_ensint
      • Dimension of control vector

    • ens_pndarray[tuple[dim_p, dim_ens], np.float64]
      • PE-local ensemble

    • v_pndarray[tuple[dim_cvec_ens], np.float64]
      • PE-local control vector

    • Vv_pndarray[tuple[dim_p], np.float64]
      • PE-local state increment

    Callback Returns
    • Vv_pndarray[tuple[dim_p], np.float64]
      • PE-local state increment

  • py__cvt_adj_ens_pdaf (Callable[iter:int, dim_p:int, dim_ens:int, dim_cv_ens_p:int, ens_p : ndarray[tuple[dim_p, dim_ens], np.float64], Vcv_p : ndarray[tuple[dim_p], np.float64], cv_p : ndarray[tuple[dim_cv_ens_p], np.float64]]) –

    Apply adjoint control vector transform matrix

    Callback Parameters
    • iterint
      • Iteration of optimization

    • dim_pint
      • PE-local observation dimension

    • dim_ensint
      • Ensemble size

    • dim_cv_ens_pint
      • PE-local dimension of control vector

    • ens_pndarray[tuple[dim_p, dim_ens], np.float64]
      • PE-local ensemble

    • Vcv_pndarray[tuple[dim_p], np.float64]
      • PE-local input vector

    • cv_pndarray[tuple[dim_cv_ens_p], np.float64]
      • PE-local result vector

    Callback Returns
    • cv_pndarray[tuple[dim_cv_ens_p], np.float64]
      • PE-local result vector

  • py__cvt_pdaf (Callable[iter:int, dim_p:int, dim_cvec:int, cv_p : ndarray[tuple[dim_cvec], np.float64], Vv_p : ndarray[tuple[dim_p], np.float64]]) –

    Apply control vector transform matrix to control vector

    Callback Parameters
    • iterint
      • Iteration of optimization

    • dim_pint
      • PE-local observation dimension

    • dim_cvecint
      • Dimension of control vector

    • cv_pndarray[tuple[dim_cvec], np.float64]
      • PE-local control vector

    • Vv_pndarray[tuple[dim_p], np.float64]
      • PE-local result vector (state vector increment)

    Callback Returns
    • Vv_pndarray[tuple[dim_p], np.float64]
      • PE-local result vector (state vector increment)

  • py__cvt_adj_pdaf (Callable[iter:int, dim_p:int, dim_cvec:int, Vcv_p : ndarray[tuple[dim_p], np.float64], cv_p : ndarray[tuple[dim_cvec], np.float64]]) –

    Apply adjoint control vector transform matrix

    Callback Parameters
    • iterint
      • Iteration of optimization

    • dim_pint
      • PE-local observation dimension

    • dim_cvecint
      • Dimension of control vector

    • Vcv_pndarray[tuple[dim_p], np.float64]
      • PE-local result vector (state vector increment)

    • cv_pndarray[tuple[dim_cvec], np.float64]
      • PE-local control vector

    Callback Returns
    • cv_pndarray[tuple[dim_cvec], np.float64]
      • PE-local control vector

  • py__obs_op_lin_pdaf (Callable[step:int, dim_p:int, dim_obs_p:int, state_p : ndarray[tuple[dim_p], np.float64], m_state_p : ndarray[tuple[dim_obs_p], np.float64]]) –

    Linearized observation operator

    Callback Parameters
    • stepint
      • Current time step

    • dim_pint
      • PE-local dimension of state

    • dim_obs_pint
      • Dimension of observed state

    • state_pndarray[tuple[dim_p], np.float64]
      • PE-local model state

    • m_state_pndarray[tuple[dim_obs_p], np.float64]
      • PE-local observed state

    Callback Returns
    • m_state_pndarray[tuple[dim_obs_p], np.float64]
      • PE-local observed state

  • py__obs_op_adj_pdaf (Callable[step:int, dim_p:int, dim_obs_p:int, state_p : ndarray[tuple[dim_p], np.float64], m_state_p : ndarray[tuple[dim_obs_p], np.float64]]) –

    Adjoint observation operator

    Callback Parameters
    • stepint
      • Current time step

    • dim_pint
      • PE-local dimension of state

    • dim_obs_pint
      • Dimension of observed state

    • state_pndarray[tuple[dim_p], np.float64]
      • PE-local model state

    • m_state_pndarray[tuple[dim_obs_p], np.float64]
      • PE-local observed state

    Callback Returns
    • state_pndarray[tuple[dim_p], np.float64]
      • PE-local model state

  • py__init_n_domains_p_pdaf (Callable[step:int, n_domains_p:int]) –

    Provide number of local analysis domains

    Callback Parameters
    • stepint
      • current time step

    • n_domains_pint
      • pe-local number of analysis domains

    Callback Returns
    • n_domains_pint
      • pe-local number of analysis domains

  • py__init_dim_l_pdaf (Callable[step:int, domain_p:int, dim_l:int]) –

    Init state dimension for local ana. domain

    Callback Parameters
    • stepint
      • current time step

    • domain_pint
      • current local analysis domain

    • dim_lint
      • local state dimension

    Callback Returns
    • dim_lint
      • local state dimension

  • py__init_dim_obs_l_pdaf (Callable[domain_p:int, step:int, dim_obs_f:int, dim_obs_l:int]) –

    Initialize local dimimension of obs. vector

    Callback Parameters
    • domain_pint
      • index of current local analysis domain

    • stepint
      • current time step

    • dim_obs_fint
      • full dimension of observation vector

    • dim_obs_lint
      • local dimension of observation vector

    Callback Returns
    • dim_obs_lint
      • local dimension of observation vector

  • py__prepoststep_pdaf (Callable[step:int, dim_p:int, dim_ens:int, dim_ens_p:int, dim_obs_p:int, state_p : ndarray[tuple[dim_p], np.float64], uinv : ndarray[tuple[dim_ens-1, dim_ens-1], np.float64], ens_p : ndarray[tuple[dim_p, dim_ens], np.float64], flag:int]) –

    User supplied pre/poststep routine

    Callback Parameters
    • stepint
      • current time step (negative for call after forecast)

    • dim_pint
      • pe-local state dimension

    • dim_ensint
      • size of state ensemble

    • dim_ens_pint
      • pe-local size of ensemble

    • dim_obs_pint
      • pe-local dimension of observation vector

    • state_pndarray[tuple[dim_p], np.float64]
      • pe-local forecast/analysis state (the array ‘state_p’ is not generally not initialized in the case of seik. it can be used freely here.)

    • uinvndarray[tuple[dim_ens-1, dim_ens-1], np.float64]
      • inverse of matrix u

    • ens_pndarray[tuple[dim_p, dim_ens], np.float64]
      • pe-local state ensemble

    • flagint
      • pdaf status flag

    Callback Returns
    • state_pndarray[tuple[dim_p], np.float64]
      • pe-local forecast/analysis state (the array ‘state_p’ is not generally not initialized in the case of seik. it can be used freely here.)

    • uinvndarray[tuple[dim_ens-1, dim_ens-1], np.float64]
      • inverse of matrix u

    • ens_pndarray[tuple[dim_p, dim_ens], np.float64]
      • pe-local state ensemble

  • outflag (int) – Status flag

Returns:

outflag – Status flag

Return type:

int