Changes between Version 1 and Version 2 of prepoststep_pdaf


Ignore:
Timestamp:
Jan 21, 2015, 2:42:18 PM (6 years ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • prepoststep_pdaf

    v1 v2  
    44
    55The routine `prepoststep_pdaf` (called `U_prepoststep` in the PDAF core routines) is a call-back routine that has to be provided by the user. 
    6 `prepoststep_pdaf` is called by `PDAF_get_state`, `PDAF_put_state_X`, and `PDAF_assimilate_X` with 'X' being the name of a filter method. The routine is called at the initial time and after a forecast (directly before computing the filter analysis step) and after the analysis step. The purpose of the routine is to give the user access to the forecast and the analysis ensembles. Typically operations that are performed in `prepoststep_pdaf` are to compute the estimated RMS errors form the ensemble and to write e.g. the state estimate (i.e. the ensemble mean state). In case of the offline mode, one will also write the model restart files in `prepoststep_pdaf`.
     6`prepoststep_pdaf` is called by `PDAF_get_state`, `PDAF_put_state_X`, and `PDAF_assimilate_X` with 'X' being the name of a filter method. The routine is called at the initial time and after a forecast (directly before computing the filter analysis step) and after the analysis step. The purpose of the routine is to give the user full access to the forecast and the analysis ensembles. Typically operations that are performed in `prepoststep_pdaf` are to compute the estimated RMS errors form the ensemble and to write e.g. the state estimate (i.e. the ensemble mean state). In case of the offline mode, one will also write the model restart files in `prepoststep_pdaf`.
    77
    88The interface is the following:
     
    1212}}}
    1313with
     14 * `step` : `integer, intent(in)`[[BR]] Current time step (When the routine is called before the analysis -step is provided.)
     15 * `dim_p` : `integer, intent(in)`[[BR]] Size of state vector (local part of process if decomposed)
     16 * `dim_ens` : `integer, intent(in)`[[BR]] Size of ensemble
     17 * `dim_ens_p` : `integer, intent(in)`[[BR]] Process-local size of ensemble
     18 * `dim_obs_p` : `integer, intent(in)`[[BR]] Size of observation vector (local part of process if decomposed)
     19 * `state_p` : `real, intent(inout), dimension(dim_p)`[[BR]] State vector (forecast or analysis). The vector is generally not initialized in the case of ESTKF/ETKF/EnKF/SEIK. IT can be used freely in this routine
     20 * `Uinv` : `real, intent(inout), dimension(dim_ens-1, dim_ens-1)`[[BR]] Inverse of the error-subspace matrix matrix A in ETKF and ESKTF; inverse of matrix U in SEIK and SEEK; not used in EnKF
     21 * `ens_p` : `real, intent(inout), dimension(dim_p, dim_ens)`[[BR]] State ensemble (process-local part of process if decomposed)
     22 * `flag` : `integer, intent(in)`[[BR]] PDAF status flag (0 if no error)
    1423
    15   INTEGER, INTENT(in) :: step        ! Current time step
    16                          ! (When the routine is called before the analysis -step is provided.)
    17   INTEGER, INTENT(in) :: dim_p       ! PE-local state dimension
    18   INTEGER, INTENT(in) :: dim_ens     ! Size of state ensemble
    19   INTEGER, INTENT(in) :: dim_ens_p   ! PE-local size of ensemble
    20   INTEGER, INTENT(in) :: dim_obs_p   ! PE-local dimension of observation vector
    21   REAL, INTENT(inout) :: state_p(dim_p) ! PE-local forecast/analysis state
    22                                      ! The array 'state_p' is not generally not initialized in the case of SEIK/EnKF/ETKF.
    23                                      ! It can be used freely in this routine.
    24   REAL, INTENT(inout) :: Uinv(dim_ens-1, dim_ens-1) ! Inverse of matrix U
    25   REAL, INTENT(inout) :: ens_p(dim_p, dim_ens)      ! PE-local state ensemble
    26   INTEGER, INTENT(in) :: flag        ! PDAF status flag
     24Notes:
     25 * The routine is called by all filter processes.
    2726
     27Hints:
     28 * If a user considers to perform adjustments to the estimates (e.g. for balances), this routine is the right place for it.
     29 * Only for the SEEK filter the state vector (`state_p`) is initialized. For all other filters, the array is allocated, but it can be used freely during the execution of `prepoststep_pdaf`.
     30 * The interface through which `prepoststep_pdaf` is called does not include the array of smoothed ensembles. In order to access the smoother ensemble array one has to set a pointer to it using a call to the routine `PDAF_get_smootherens` (see page on [AuxiliaryRoutines auxiliary routines])
    2831
    29 The routine `U_prepoststep` is called once at the beginning of the assimilation process. In addition, it is called during the assimilation cycles before the analysis step and after the ensemble transformation. The routine is called by all filter processes (that is `filterpe=1`).
    30 
    31 The routine provides for the user the full access to the ensemble of model states. Thus, user-controlled pre- and post-step operations can be performed.  For example the forecast and the analysis states and ensemble covariance matrix can be analyzed, e.g. by computing the estimated variances. If the smoother is used, also the smoothed ensembles can be analyzed. In addition, the estimates can be written to disk.
    32 
    33 Hint:
    34  * If a user considers to perform adjustments to the estimates (e.g. for balances), this routine is the right place for it.
    35  * Only for the SEEK filter the state vector (`state_p`) is initialized. For all other filters, the array is allocated, but it can be used freely during the execution of `U_prepoststep`.
    36  * The interface through which `U_prepoststep` is called does not include the array of smoothed ensembles. In order to access the smoother ensemble array one has to set a pointer to it using a call to the routine `PDAF_get_smootherens` (see page on [AuxiliaryRoutines auxiliary routines])
    37