Changes between Version 15 and Version 16 of ImplementAnalysisGlobal


Ignore:
Timestamp:
Nov 24, 2020, 11:16:49 AM (3 months ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ImplementAnalysisGlobal

    v15 v16  
    4040{{{
    4141  SUBROUTINE PDAFomi_assimilate_global(U_collect_state, U_distribute_state, &
    42                                  U_init_dim_obs, U_obs_op, U_init_obs, &
     42                                 U_init_dim_obs_pdafomi, U_obs_op_pdafomi, &
    4343                                 U_prepoststep, U_next_observation, status)
    4444}}}
     
    4646 * [#U_collect_statecollect_state_pdaf.F90 U_collect_state]: The name of the user-supplied routine that initializes a state vector from the array holding the ensemble of model states from the model fields. This is basically the inverse operation to `U_distribute_state` used in `PDAF_get_state` as well as here.
    4747 * [#U_distribute_statedistribute_state_pdaf.F90 U_distribute_state]:  The name of a user supplied routine that initializes the model fields from the array holding the ensemble of model state vectors.
    48  * [#U_init_dim_obscallback_obs_pdafomi.F90 U_init_dim_obs]: The name of the user-supplied routine that initializes the observation information and provides the size of observation vector
    49  * [#U_obs_opcallback_obs_pdafomi.F90 U_obs_op]: The name of the user-supplied routine that acts as the observation operator on some state vector
     48 * [#U_init_dim_obs_pdafomicallback_obs_pdafomi.F90 U_init_dim_obs_pdafomi]: The name of the user-supplied routine that initializes the observation information and provides the size of observation vector
     49 * [#U_obs_op_pdafomicallback_obs_pdafomi.F90 U_obs_op_pdafomi]: The name of the user-supplied routine that acts as the observation operator on some state vector
    5050 * [#U_prepoststepprepoststep_ens_pdaf.F90 U_prepoststep]: The name of the pre/poststep routine as in `PDAF_get_state`
    5151 * [#U_next_observationnext_observation.F90 U_next_observation]: The name of a user supplied routine that initializes the variables `nsteps`, `timenow`, and `doexit`. The same routine is also used in `PDAF_get_state`.
     
    6060{{{
    6161  SUBROUTINE PDAFomi_put_state_global(U_collect_state, &
    62                                  U_init_dim_obs, U_obs_op, U_init_obs, &
     62                                 U_init_dim_obs, U_obs_op, &
    6363                                 U_prepoststep, status)
    6464}}}
     
    7676
    7777This routine is independent of the filter algorithm used.
     78
    7879See the page on [InsertAnalysisStep#U_collect_statecollect_state_pdaf.F90 inserting the analysis step] for the description of this routine.
    7980
     
    8283
    8384This routine is independent of the filter algorithm used.
     85
    8486See the page on [InsertAnalysisStep#U_distribute_statedistribute_state_pdaf.F90 inserting the analysis step] for the description of this routine.
    8587
    8688
    87 === `U_init_dim_obs` (callback_obs_pdafomi.F90) ===
     89=== `U_init_dim_obs_pdafomi` (callback_obs_pdafomi.F90) ===
    8890
    89 This is a call-back routine for PDAF-OMI. The routine just calls a routine from the observation module for each observation type.
     91This is a call-back routine for PDAF-OMI initializing the observation information. The routine just calls a routine from the observation module for each observation type.
     92
    9093See the [wiki:OMI_Callback_obs_pdafomi documentation on callback_obs_pdafomi.F90] for more information.
    9194
    9295
    9396
    94 === `U_obs_op` (callback_obs_pdafomi.F90) ===
     97=== `U_obs_op_pdafomi` (callback_obs_pdafomi.F90) ===
    9598
    96 The interface for this routine is:
    97 {{{
    98 SUBROUTINE obs_op_pdafomi(step, dim_p, dim_obs_p, state_p, m_state_p)
     99This is a call-back routine for PDAF-OMI applying the observation operator to the state vector. The routine calls a routine from the observation module for each observation type.
    99100
    100   INTEGER, INTENT(in) :: step               ! Currrent time step
    101   INTEGER, INTENT(in) :: dim_p              ! PE-local dimension of state
    102   INTEGER, INTENT(in) :: dim_obs_p          ! Dimension of observed state
    103   REAL, INTENT(in)    :: state_p(dim_p)     ! PE-local model state
    104   REAL, INTENT(out) :: m_state_p(dim_obs_p) ! PE-local observed state
    105 }}}
    106 
    107 The routine is called during the analysis step. It has to perform the operation of the observation operator acting on a state vector that is provided as `state_p`. The observed state has to be returned in `m_state_p`.
    108 
    109 For a model using domain decomposition, the operation is on the PE-local sub-domain of the model and has to provide the observed sub-state for the PE-local domain.
    110 
    111 With PDAF-OMI, the routine just calls a routine from the observation module for each observation type.
     101See the [wiki:OMI_Callback_obs_pdafomi documentation on callback_obs_pdafomi.F90] for more information.
    112102
    113103
    114104=== `U_prepoststep` (prepoststep_ens_pdaf.F90) ===
    115105
    116 The routine has already been described on the [ModifyModelforEnsembleIntegration#U_prepoststepprepoststep_ens_pdaf.F90 page on modifying the model code for the ensemble integration]. For completeness, the description is repeated:
     106The routine has already been described for modifying the model for the ensemble integration and for inserting the analysis step.
    117107
    118 The interface of the routine is identical for all filters. However, the particular operations that are performed in the routine can be specific for each filter algorithm.
    119 
    120 The interface for this routine is
    121 {{{
    122 SUBROUTINE prepoststep(step, dim_p, dim_ens, dim_ens_p, dim_obs_p, &
    123                        state_p, Uinv, ens_p, flag)
    124 
    125   INTEGER, INTENT(in) :: step        ! Current time step
    126                          ! (When the routine is called before the analysis -step is provided.)
    127   INTEGER, INTENT(in) :: dim_p       ! PE-local state dimension
    128   INTEGER, INTENT(in) :: dim_ens     ! Size of state ensemble
    129   INTEGER, INTENT(in) :: dim_ens_p   ! PE-local size of ensemble
    130   INTEGER, INTENT(in) :: dim_obs_p   ! PE-local dimension of observation vector
    131   REAL, INTENT(inout) :: state_p(dim_p) ! PE-local forecast/analysis state
    132                                      ! The array 'state_p' is not generally not initialized in the case of SEIK/EnKF/ETKF/ESTKF.
    133                                      ! It can be used freely in this routine.
    134   REAL, INTENT(inout) :: Uinv(dim_ens-1, dim_ens-1) ! Inverse of matrix U
    135   REAL, INTENT(inout) :: ens_p(dim_p, dim_ens)      ! PE-local state ensemble
    136   INTEGER, INTENT(in) :: flag        ! PDAF status flag
    137 }}}
    138 
    139 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`).
    140 
    141 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. In addition, the estimates can be written to disk.
    142 
    143 Hint:
    144  * If a user considers to perform adjustments to the estimates (e.g. for balances), this routine is the right place for it.
    145  * 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`.
    146  * The interface has a difference for ETKF and ESTKF: For the ETKF, the array `Uinv` has size `dim_ens` x `dim_ens`. In contrast it has size `dim_ens-1` x `dim_ens-1` for the ESTKF. (For most cases, this will be irrelevant, because most usually the ensemble array `ens_p` is used for computations, rather than `Uinv`. Only for the SEIK filter with fixed covariance matrix, `Uinv` is required to compute the estimate analysis error. The fixed covariance matrix mode is not available for the ETKF or ESTKF.)
    147  * 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])
     108See the page on [InsertAnalysisStep#U_prepoststepprepoststep_ens_pdaf.F90 inserting the analysis step] for the description of this routine.
    148109
    149110
     
    151112
    152113This routine is independent of the filter algorithm used.
     114
    153115See the page on [InsertAnalysisStep#U_next_observationnext_observation_pdaf.F90 inserting the analysis step] for the description of this routine.
    154116
     
    156118== Execution order of user-supplied routines ==
    157119
    158 The user-supplied routines are essentially executed in the order they are listed in the interface to `PDAFomi_assimilate_global`. The order can be important as some routines can perform preparatory work for later routines. For example, `U_init_dim_obs` prepares an index array that provides the information for executing the observation operator in `U_obs_op`. How this information is initialized is described in the documentation of OMI.
     120The user-supplied routines are essentially executed in the order they are listed in the interface to `PDAFomi_assimilate_global`. The order can be important as some routines can perform preparatory work for later routines. For example, `U_init_dim_obs_pdafomi` prepares an index array that provides the information for executing the observation operator in `U_obs_op_pdafomi`. How this information is initialized is described in the documentation of OMI.
    159121
    160122Before the analysis step is called the following routine is executed:
     
    163125The analysis step is executed when the ensemble integration of the forecast is completed. During the analysis step the following routines are executed in the given order:
    164126 1. [#U_prepoststepprepoststep_ens_pdaf.F90 U_prepoststep] (Call to act on the forecast ensemble, called with negative value of the time step)
    165  1. [#U_init_dim_obsinit_dim_obs_pdaf.F90 U_init_dim_obs]
    166  1. [#U_obs_opobs_op_pdaf.F90 U_obs_op] (multiple calls, one for each ensemble member)
    167  1. [#U_prodRinvAprodrinva_pdaf.F90 U_prodRinvA]
     127 1. [#U_init_dim_obs_pdafomicallback_obs_pdafomi.F90 U_init_dim_obs_pdafomi]
     128 1. [#U_obs_op_pdafomicallback_obs_pdafomi.F90 U_obs_op_pdafomi] (multiple calls, one for each ensemble member)
    168129 1. [#U_prepoststepprepoststep_ens_pdaf.F90 U_prepoststep] (Call to act on the analysis ensemble, called with (positive) value of the time step)
    169130