Changes between Version 12 and Version 13 of ImplementAnalysisletkf


Ignore:
Timestamp:
May 5, 2014, 1:32:16 PM (10 years ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ImplementAnalysisletkf

    v12 v13  
    1111<li><a href="ImplementationofAnalysisStep">Implementation of the analysis step</a></li>
    1212<ol>
     13<li><a href="ImplementAnalysisestkf">Implementation for ESTKF</a></li>
     14<li><a href="ImplementAnalysislestkf">Implementation for LESTKF</a></li>
     15<li><a href="ImplementAnalysisetkf">Implementation for ETKF</a></li>
     16<li>Implementation for LETKF</li>
    1317<li><a href="ImplementAnalysisseik">Implementation for SEIK</a></li>
    1418<li><a href="ImplementAnalysislseik">Implementation for LSEIK</a></li>
    15 <li><a href="ImplementAnalysisetkf">Implementation for ETKF</a></li>
    16 <li>Implementation for LETKF</li>
    1719<li><a href="ImplementAnalysisseek">Implementation for SEEK</a></li>
    1820<li><a href="ImplementAnalysisenkf">Implementation for EnKF</a></li>
    19 <li><a href="ImplementAnalysisestkf">Implementation for ESTKF</a></li>
    20 <li><a href="ImplementAnalysislestkf">Implementation for LESTKF</a></li>
    2121</ol>
    2222<li><a href="AddingMemoryandTimingInformation">Memory and timing information</a></li>
     
    3030== Overview ==
    3131
    32 For the analysis step of the LETKF algorithm, several operations related to the observations are needed. These operations are requested by PDAF by calling user-supplied routines. Intentionally, the operations are split into separate routines in order to keep the operations rather elementary as this procedure should simplify the implementation. The names of the required routines are specified in the call to the routine `PDAF_put_state_letkf` described below. With regard to the parallelization, all these routines (except `U_collect_state`) are executed by the filter processes (`filterpe=.true.`) only.
    33 
    34 For completeness we discuss here all user-supplied routines that are specified in the interface to `PDAF_put_state_letkf`. Many of the routines are localized versions of those that are needed for the global ETKF method. Hence, if the user-supplied routines for the global ETKF method have been already implemented, one can base on these routines to speed up the implementation. Due to this, it can also be reasonable to first fully implement a global filter version and subsequently implement the corresponding localized filter by modifying and extending the global routines.
     32For the analysis step of the LETKF algorithm, several operations related to the observations are needed. These operations are requested by PDAF by calling user-supplied routines. Intentionally, the operations are split into separate routines in order to keep the operations rather elementary as this procedure should simplify the implementation. The names of the required routines are specified in the call to the routine `PDAF_assimilate_letkf` (or `PDAF_put_state_letkf`) described below. With regard to the parallelization, all these routines (except `U_collect_state`) are executed by the filter processes (`filterpe=.true.`) only.
     33
     34For completeness we discuss here all user-supplied routines that are specified in the interface to `PDAF_assimilate_letkf`. Many of the routines are localized versions of those that are needed for the global ETKF method. Hence, if the user-supplied routines for the global ETKF method have been already implemented, one can base on these routines to speed up the implementation. Due to this, it can also be reasonable to first fully implement a global filter version and subsequently implement the corresponding localized filter by modifying and extending the global routines.
    3535
    3636The LSEIK filter and the LETKF (Local Ensemble Transform Kalman Filter) are very similar. For this reason, the interface to the user-supplied routines is almost identical. Depending on the implementation it can be possible to use identical routines for the LSEIK filter and the LETKF. Differences are marked in the text below.
     
    3838== `PDAF_put_state_letkf` ==
    3939
    40 The general espects of the filter-specific routines `PDAF_put_state_*` have been described on the page [ModifyModelforEnsembleIntegration Modification of the model code for the ensemble integration].
    41 The interface for the routine `PDAF_put_state_letkf` contains several routine names for routines that operate on the local analysis domains (marked by `_l` at the end of the routine name). In addition, there are names for routines that consider all available observations required to perform local analyses with LETKF within some sub-domain of a domain-decomposed model (marked by `_f` at the end of the routine name). In case of a serial execution of the assimilation program, these will be all globally available observations. However, if the program is executed with parallelization, this might be a smaller set of observations.
     40The general espects of the filter-specific routines `PDAF_assimilate_*` have been described on the page [ModifyModelforEnsembleIntegration Modification of the model code for the ensemble integration].
     41The interface for the routine `PDAF_assimilate_letkf` contains several routine names for routines that operate on the local analysis domains (marked by `_l` at the end of the routine name). In addition, there are names for routines that consider all available observations required to perform local analyses with LETKF within some sub-domain of a domain-decomposed model (marked by `_f` at the end of the routine name). In case of a serial execution of the assimilation program, these will be all globally available observations. However, if the program is executed with parallelization, this might be a smaller set of observations.
    4242
    4343To explain the  difference, it is assumed, for simplicity, that a local analysis domain consists of a single vertical column of the model grid. In addition, we assume that the domain decomposition splits the global model domain by vertical boundaries as is typical for ocean models and that the observations are spatially distributed observations of model fields that are part of the state vector.  Under these assumptions, the situation is the following: When a model uses domain decomposition, the LETKF algorithm is executed such that for each model sub-domain a loop over all local analysis domains (e.g. vertical columns) that belong to the model sub-domain is performed. As each model sub-domain is treated by a different process, all loops are executed parallel to each other.
     
    4747The interface when using the LETKF algorithm is the following:
    4848{{{
    49   SUBROUTINE PDAF_put_state_letkf(U_collect_state, U_init_dim_obs_f, U_obs_op_f, U_init_obs_f, &
    50                                   U_init_obs_l, U_prepoststep, U_prodRinvA_l, U_init_n_domains, &
    51                                   U_init_dim_l, U_init_dim_obs_l, &
     49  SUBROUTINE PDAF_assimilate_letkf(U_collect_state, U_distribute_state, U_init_dim_obs_f, U_obs_op_f, &
     50                                  U_init_obs_f, U_init_obs_l, U_prepoststep, U_prodRinvA_l, &
     51                                  U_init_n_domains, U_init_dim_l, U_init_dim_obs_l, &
    5252                                  U_g2l_state, U_l2g_state, U_g2l_obs, &
    53                                   U_init_obsvar, U_init_obsvar_l, status)
     53                                  U_init_obsvar, U_init_obsvar_l, U_next_observation, status)
    5454}}}
    5555with the following arguments:
    5656 * [#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 [ModifyModelforEnsembleIntegration#PDAF_get_state PDAF_get_state]
     57 * [#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.
    5758 * [#U_init_dim_obs_finit_dim_obs_f_pdaf.F90 U_init_dim_obs_f]: The name of the user-supplied routine that provides the size of the full observation vector
    5859 * [#U_obs_op_fobs_op_f_pdaf.F90 U_obs_op_f]: The name of the user-supplied routine that acts as the full observation operator on some state vector
     
    6970 * [#U_init_obsvarinit_obsvar_pdaf.F90 U_init_obsvar]: The name of the user-supplied routine that provides a global mean observation error variance (This routine will only be executed, if an adaptive forgetting factor is used)
    7071 * [#U_init_obsvar_linit_obsvar_l_pdaf.F90 U_init_obsvar_l]: The name of the user-supplied routine that provides a mean observation error variance for the local analysis domain (This routine will only be executed, if a local adaptive forgetting factor is used)
    71  * `status`: The integer status flag. It is zero, if `PDAF_put_state_letkf` is exited without errors.
     72 * [#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`.
     73 * `status`: The integer status flag. It is zero, if `PDAF_assimilate_letkf` is exited without errors.
    7274
    7375Note:
    7476 * The order of the routine names does not show the order in which these routines are executed. See the [#Executionorderofuser-suppliedroutines section on the order of the execution] at the bottom of this page.
    7577
     78
     79== `PDAF_put_state_letkf` ==
     80
     81When the 'flexible' implementation variant is chosen for the assimilation system, the routine `PDAF_put_state_letkf` has to be used instead of `PDAF_assimilate_letkf`. The general aspects of the filter specific routines `PDAF_put_state_*` have been described on the page [ModifyModelforEnsembleIntegration Modification of the model code for the ensemble integration]. The interface of the routine is identical with that of `PDAF_assimilate_letkf` with the exception the specification of the user-supplied routines `U_distribute_state` and `U_next_observation` are missing.
     82
     83The interface when using the LETKF algorithm is the following:
     84{{{
     85  SUBROUTINE PDAF_put_state_letkf(U_collect_state, U_init_dim_obs_f, U_obs_op_f, U_init_obs_f, &
     86                                  U_init_obs_l, U_prepoststep, U_prodRinvA_l, U_init_n_domains, &
     87                                  U_init_dim_l, U_init_dim_obs_l, &
     88                                  U_g2l_state, U_l2g_state, U_g2l_obs, &
     89                                  U_init_obsvar, U_init_obsvar_l, status)
     90}}}
     91
     92
    7693== User-supplied routines ==
    7794
    78 Here, all user-supplied routines are described that are required in the call to `PDAF_put_state_letkf`. For some of the generic routines, we link to the page on [ModifyModelforEnsembleIntegration modifying the model code for the ensemble integration].
     95Here, all user-supplied routines are described that are required in the call to `PDAF_assimilate_letkf`. For some of the generic routines, we link to the page on [ModifyModelforEnsembleIntegration modifying the model code for the ensemble integration].
    7996
    8097To indicate user-supplied routines we use the prefix `U_`. In the template directory `templates/` as well as in the example implementation in `testsuite/src/dummymodel_1D` these routines exist without the prefix, but with the extension `_pdaf.F90`. In the section titles below we provide the name of the template file in parentheses.
     
    85102
    86103This routine is independent from the filter algorithm used.
    87 See the mape on [ModifyModelforEnsembleIntegration#U_collect_statecollect_state_pdaf.F90 modifying the model code for the ensemble integration] for the description of this routine.
     104See the mape on [InsertAnalysisStep#U_collect_statecollect_state_pdaf.F90 inserting the analysis step] for the description of this routine.
     105
     106=== `U_distribute_state` (distribute_state_pdaf.F90) ===
     107
     108This routine is independent of the filter algorithm used.
     109See the page on [InsertAnalysisStep#U_distribute_statedistribute_state_pdaf.F90 inserting the analysis step] for the description of this routine.
    88110
    89111
     
    407429 * If the local adaptive forgetting factor is not used, this routine has only to exist for the compilation, but it does not need functionality.
    408430
     431
     432=== `U_next_observation` (next_observation_pdaf.F90) ===
     433
     434This routine is independent of the filter algorithm used.
     435See the page on [InsertAnalysisStep#U_next_observationnext_observation_pdaf.F90 inserting the analysis step] for the description of this routine.
     436
    409437== Execution order of user-supplied routines ==
    410438
     
    436464 1. [#U_prepoststepprepoststep_ens_pdaf.F90 U_prepoststep] (Call to act on the analysis ensemble, called with (positive) value of the time step)
    437465
    438 
    439 
     466In case of the routine `PDAF_assimilate_lestkf`, the following routines are executed after the analysis step:
     467 1. [#U_distribute_statedistribute_state_pdaf.F90 U_distribute_state]
     468 1. [#U_next_observationnext_observation_pdaf.F90 U_next_observation]
     469
     470