Changes between Version 10 and Version 11 of ModifyModelforEnsembleIntegration


Ignore:
Timestamp:
Aug 26, 2010, 3:38:35 PM (14 years ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ModifyModelforEnsembleIntegration

    v10 v11  
    7878== User-supplied routines ==
    7979
     80Here, one the user-supplied routines are discussed that are required at this stage of the implementation (that is, the ensemble integration). The routines that are required to conduct the analysis step of some filter, are described in the main section about the implementation of the analysis step.
     81
    8082To indicate user-supplied routines we use the prefix `U_`. In the template directory `templates/` these routines are provided in files with the routines name without this prefix. In the example implementation in `testsuite/src/dummymodel_1D` the routines exist without the prefix, but with the extension `_dummy_D.F90`. In the section titles below we provide the name of the template file in parentheses.
    8183
     
    101103 * At the first call to `U_next_obs` the variable `timenow` should be initialized with the current model time. At the next call a forecast phase has been completed. Thus, the new value of `timenow` follows from the timer interval for the previous forecast phase.
    102104
    103 === `U_distribute_state` (distributed_state.F90) ===
     105=== `U_distribute_state` (distribute_state.F90) ===
    104106
    105107The interface for this routine is
     
    113115This routine is called during the forecast phase as many times as there are states to be integrated by a model task. Again, the routine is executed by all processes that belong to model tasks.
    114116
    115 When the routine is called a state vector `state_p` and its size `dim_p` are provided. As the user has defines how the model fields are stored in the state vector, one can initialize the model fields from this information. If the model is not parallelized, `state_p` will contain a full state vector. If the model is parallelized using domain decomposition, `state_p` will contain the part of the state vector that corresponds to the model sub-domain for the calling process.
     117When the routine is called a state vector `state_p` and its size `dim_p` are provided. As the user has defined how the model fields are stored in the state vector, one can initialize the model fields from this information. If the model is not parallelized, `state_p` will contain a full state vector. If the model is parallelized using domain decomposition, `state_p` will contain the part of the state vector that corresponds to the model sub-domain for the calling process.
    116118
    117119Some hints:
    118120 * If the state vector does not include all model fields, it can be useful to keep a separate array to store those additional fields. This array has to be kept separate from PDAF, but can be defined using a module like `mod_assimilation`.
    119121
    120 === U_prepoststep (prepoststep_seik.F90) ===
     122=== `U_prepoststep` (prepoststep_seik.F90) ===
    121123
     124The 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. Here, we exemplify the interface on the example of the SEIK filter.
     125
     126The interface for this routine is
     127{{{
     128SUBROUTINE prepoststep(step, dim_p, dim_ens, dim_ens_p, dim_obs_p, &
     129                       state_p, Uinv, ens_p, flag)
     130
     131  INTEGER, INTENT(in) :: step        ! Current time step
     132                         ! (When the routine is called before the analysis -step is provided.)
     133  INTEGER, INTENT(in) :: dim_p       ! PE-local state dimension
     134  INTEGER, INTENT(in) :: dim_ens     ! Size of state ensemble
     135  INTEGER, INTENT(in) :: dim_ens_p   ! PE-local size of ensemble
     136  INTEGER, INTENT(in) :: dim_obs_p   ! PE-local dimension of observation vector
     137  REAL, INTENT(inout) :: state_p(dim_p) ! PE-local forecast/analysis state
     138                         ! The array 'state_p' is not generally not initialized in the case of SEIK.
     139                         ! It can be used freely here.
     140  REAL, INTENT(inout) :: Uinv(dim_ens-1, dim_ens-1) ! Inverse of matrix U
     141  REAL, INTENT(inout) :: ens_p(dim_p, dim_ens)      ! PE-local state ensemble
     142  INTEGER, INTENT(in) :: flag        ! PDAF status flag
     143}}}
     144
     145The 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`).
     146
     147The 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.
     148
     149Hint:
     150 * If a user considers to perform adjustments to the estimates (e.g. for balances), this routine is the right place for it.
     151
     152
     153=== `U_collect_state` (collect_state.F90) ===
     154
     155The interface for this routine is
     156{{{
     157SUBROUTINE collect_state(dim_p, state_p)
     158
     159  INTEGER, INTENT(in) :: dim_p           ! State dimension for PE-local model sub-domain
     160  REAL, INTENT(inout) :: state_p(dim_p)  ! State vector for PE-local model sub-domain
     161}}}
     162
     163This routine is called during the forecast phase as many times as there are states to be integrated by a model task. It is called at the end of the integration of a member state of the ensemble. The routine is executed by all processes that belong to model tasks.
     164
     165When the routine is called, a state vector `state_p` and its size `dim_p` are provided. The operation to be performed in this routine is inverse to that of the routine `U_distribute_state`. That is, the state vector `state_p` has to be initialized from the model fields. If the model is not parallelized, `state_p` will contain a full state vector. If the model is parallelized using domain decomposition, `state_p` will contain the part of the state vector that corresponds to the model sub-domain for the calling process.
     166
     167Some hints:
     168 * If the state vector does not include all model fields, it can be useful to keep a separate array to store those additional fields. This array has to be kept separate from PDAF, but can be defined using a module like `mod_assimilation`.
    122169
    123170== Simulating model errors ==