pyPDAF.PDAF.get_state

pyPDAF.PDAF.get_state()

Post-processing the analysis and distributing state vector back to the model.

This function also sets the next model step for assimilation, or end the entire assimilation.

The function executes the user-supplied function in the following sequence:

  1. py__prepoststep_state_pdaf

  2. py__distribute_state_pdaf

  3. py__next_observation_pdaf

Parameters:
  • steps (int) – Flag and number of time steps

  • doexit (int) – Whether to exit from forecasts

  • py__next_observation_pdaf (Callable[stepnow:int, nsteps:int, doexit:int, time:float]) –

    Provide time step and time of next observation

    Callback Parameters
    • stepnowint
      • number of the current time step

    • nstepsint
      • number of time steps until next obs

    • doexitint
      • whether to exit forecasting (1 for exit)

    • timefloat
      • current model (physical) time

    Callback Returns
    • nstepsint
      • number of time steps until next obs

    • doexitint
      • whether to exit forecasting (1 for exit)

    • timefloat
      • current model (physical) time

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

    Routine to distribute 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__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

  • flag (int) – Status flag

Returns:

  • steps (int) – Flag and number of time steps

  • time (float) – current model time

  • doexit (int) – Whether to exit from forecasts

  • flag (int) – Status flag