Changes between Version 4 and Version 5 of ImplementAnalysisletkf


Ignore:
Timestamp:
Sep 15, 2011, 3:34:06 PM (13 years ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ImplementAnalysisletkf

    v4 v5  
    5252}}}
    5353with the following arguments:
    54  * [#U_collect_statecollect_state.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]
    55  * [#U_init_dim_obs_fullinit_dim_obs_full.F90 U_init_dim_obs_full]: The name of the user-supplied routine that provides the size of the full observation vector
    56  * [#U_obs_op_fullobs_op_full.F90 U_obs_op_full]: The name of the user-supplied routine that acts as the full observation operator on some state vector
    57  * [#U_init_obs_fullinit_obs_full.F90 U_init_obs_full]: The name of the user-supplied routine that initializes the full vector of observations
    58  * [#U_init_obs_localinit_obs_local.F90 U_init_obs_local]: The name of the user-supplied routine that initializes the vector of observations for a local analysis domain
    59  * [#U_prepoststepprepoststep_seik.F90 U_prepoststep]: The name of the pre/poststep routine as in `PDAF_get_state`
    60  * [#U_prodRinvA_localprodrinva_local.F90 U_prodRinvA_local]: The name of the user-supplied routine that computes the product of the inverse of the observation error covariance matrix with some matrix provided to the routine by PDAF.
    61  * [#U_init_n_domainsinit_n_domains.F90 U_init_n_domains]: The name of the routine that provides the number of local analysis domains
    62  * [#U_init_dim_localinit_dim_local.F90 U_init_dim_local]: The name of the routine that provides the state dimension for a local analysis domain
    63  * [#U_init_dim_obs_localinit_dim_obs_local.F90 U_init_dim_obs_local]: The name of the routine that initializes the size of the observation vector for a local analysis domain
    64  * [#U_global2local_stateglobal2local_state.F90 U_global2local_state]: The name of the routine that initializes a local state vector from the global state vector
    65  * [#U_local2global_statelocal2global_state.F90 U_local2global_state]: The name of the routine that initializes the corresponding part of the global state vector from the the provided local state vector
    66  * [#U_global2local_obsglobal2local_obs.F90 U_global2local_obs]: The name of the routine that initializes a local observation vector from a full observation vector
    67  * [#U_init_obsvarinit_obsvar.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)
    68  * [#U_init_obsvar_localinit_obsvar_local.F90 U_init_obsvar_local]: 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)
     54 * [#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]
     55 * [#U_init_dim_obs_fullinit_dim_obs_full_pdaf.F90 U_init_dim_obs_full]: The name of the user-supplied routine that provides the size of the full observation vector
     56 * [#U_obs_op_fullobs_op_full_pdaf.F90 U_obs_op_full]: The name of the user-supplied routine that acts as the full observation operator on some state vector
     57 * [#U_init_obs_fullinit_obs_full_pdaf.F90 U_init_obs_full]: The name of the user-supplied routine that initializes the full vector of observations
     58 * [#U_init_obs_localinit_obs_local_pdaf.F90 U_init_obs_local]: The name of the user-supplied routine that initializes the vector of observations for a local analysis domain
     59 * [#U_prepoststepprepoststep_seik_pdaf.F90 U_prepoststep]: The name of the pre/poststep routine as in `PDAF_get_state`
     60 * [#U_prodRinvA_localprodrinva_local_pdaf.F90 U_prodRinvA_local]: The name of the user-supplied routine that computes the product of the inverse of the observation error covariance matrix with some matrix provided to the routine by PDAF.
     61 * [#U_init_n_domainsinit_n_domains_pdaf.F90 U_init_n_domains]: The name of the routine that provides the number of local analysis domains
     62 * [#U_init_dim_localinit_dim_local_pdaf.F90 U_init_dim_local]: The name of the routine that provides the state dimension for a local analysis domain
     63 * [#U_init_dim_obs_localinit_dim_obs_local_pdaf.F90 U_init_dim_obs_local]: The name of the routine that initializes the size of the observation vector for a local analysis domain
     64 * [#U_global2local_stateglobal2local_state_pdaf.F90 U_global2local_state]: The name of the routine that initializes a local state vector from the global state vector
     65 * [#U_local2global_statelocal2global_state_pdaf.F90 U_local2global_state]: The name of the routine that initializes the corresponding part of the global state vector from the the provided local state vector
     66 * [#U_global2local_obsglobal2local_obs_pdaf.F90 U_global2local_obs]: The name of the routine that initializes a local observation vector from a full observation vector
     67 * [#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)
     68 * [#U_init_obsvar_localinit_obsvar_local_pdaf.F90 U_init_obsvar_local]: 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)
    6969 * `status`: The integer status flag. It is zero, if `PDAF_put_state_letkf` is exited without errors.
    7070
     
    7676Here, 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].
    7777
    78 To indicate user-supplied routines we use the prefix `U_`. In the template directory `templates/` these routines are provided in files with the routine's 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.
     78To indicate user-supplied routines we use the prefix `U_`. In the template directory `templates/` these routines are provided in files with the routine's name without this prefix. In the example implementation in `testsuite/src/dummymodel_1D`, the 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.
    7979
    8080In the subroutine interfaces some variables appear with the suffix `_p` (short for 'process'). This suffix indicates that the variable is particular to a model sub-domain, if a domain decomposed model is used. Thus, the value(s) in the variable will be different for different model sub-domains. In addition, there will be variables with the suffix `_f` (for 'full') and with the suffix `_l` (for 'local').
    8181
    82 === `U_collect_state` (collect_state.F90) ===
     82=== `U_collect_state` (collect_state_pdaf.F90) ===
    8383
    8484This routine is independent from the filter algorithm used.
    85 See the mape on [ModifyModelforEnsembleIntegration#U_collect_statecollect_state.F90 modifying the model code for the ensemble integration] for the description of this routine.
    86 
    87 
    88 === `U_init_dim_obs_full` (init_dim_obs_full.F90) ===
     85See the mape on [ModifyModelforEnsembleIntegration#U_collect_statecollect_state_pdaf.F90 modifying the model code for the ensemble integration] for the description of this routine.
     86
     87
     88=== `U_init_dim_obs_full` (init_dim_obs_full_pdaf.F90) ===
    8989
    9090This routine is used by all filter algorithms with domain-localization (LSEIK, LETKF) and is independent of the particular algorithm.
     
    104104 * The routine is similar to `init_dim_obs` used in the global filters. However, if the global filter is used with a domain-decomposed model, it only initializes the size of the observation vector for the local model sub-domain. This is different for the local filters, as the local analysis also requires observational data from neighboring model sub-domains. Nonetheless, one can base on an implemented routine `init_dim_obs` to implement `init_dim_obs_full`.
    105105
    106 === `U_obs_op_full` (obs_op_full.F90) ===
     106=== `U_obs_op_full` (obs_op_full_pdaf.F90) ===
    107107
    108108This routine is used by all filter algorithms with domain-localization (LSEIK, LETKF) and is independent of the particular algorithm.
     
    112112SUBROUTINE obs_op_full(step, dim_p, dim_obs_f, state_p, m_state_f)
    113113
    114   INTEGER, INTENT(in) :: step               ! Currrent time step
     114  INTEGER, INTENT(in) :: step               ! Current time step
    115115  INTEGER, INTENT(in) :: dim_p              ! PE-local dimension of state
    116116  INTEGER, INTENT(in) :: dim_obs_f          ! Dimension of the full observed state
     
    124124 * The routine is similar to `init_dim_obs` used for the global filters. However, with a domain-decomposed model `m_state_f` will contain parts of the state vector from neighboring model sub-domains. To make these parts accessible, some parallel communication will be necessary (The state information for a neighboring model sub-domain, will be in the memory of the process that handles that sub-domain). The example implementation in `testsuite/dummymodel_1d` uses the function `MPI_AllGatherV` for this communication.
    125125
    126 === `U_init_obs_full` (init_obs_full.F90) ===
     126=== `U_init_obs_full` (init_obs_full_pdaf.F90) ===
    127127
    128128This routine is used by all filter algorithms with domain-localization (LSEIK, LETKF) and is independent of the particular algorithm.
     
    145145
    146146
    147 === `U_init_obs_local` (init_obs_local.F90) ===
     147=== `U_init_obs_local` (init_obs_local_pdaf.F90) ===
    148148
    149149This routine is used by all filter algorithms with domain-localization (LSEIK, LETKF) and is independent of the particular algorithm.
     
    167167
    168168
    169 === `U_prepoststep` (prepoststep_seik.F90) ===
     169=== `U_prepoststep` (prepoststep_seik_pdaf.F90) ===
    170170
    171171This routine can generally be identical to that used for the global SEIK filter, which has already been described on the [ModifyModelforEnsembleIntegration#U_prepoststepprepoststep_seik.F90 page on modifying the model code for the ensemble integration]. For completeness, the description is repeated:
     
    203203
    204204
    205 === `U_prodRinvA_local` (prodrinva_local.F90) ===
     205=== `U_prodRinvA_local` (prodrinva_local_pdaf.F90) ===
    206206
    207207This routine is used by the local filters (LSEIK and LETKF). There is a slight difference between LSEIK and LETKF for this routine, which is described below.
     
    231231
    232232
    233 === `U_init_n_domains` (init_n_domains.F90) ===
     233=== `U_init_n_domains` (init_n_domains_pdaf.F90) ===
    234234
    235235This routine is used by all filter algorithms with domain-localization (LSEIK, LETKF) and is independent of the particular algorithm.
     
    250250
    251251
    252 === `U_init_dim_local` (init_dim_local.F90) ===
     252=== `U_init_dim_local` (init_dim_local_pdaf.F90) ===
    253253
    254254This routine is used by all filter algorithms with domain-localization (LSEIK, LETKF) and is independent of the particular algorithm.
     
    270270
    271271
    272 === `U_init_dim_obs_local` (init_dim_obs_local.F90) ===
     272=== `U_init_dim_obs_local` (init_dim_obs_local_pdaf.F90) ===
    273273
    274274This routine is used by all filter algorithms with domain-localization (LSEIK, LETKF) and is independent of the particular algorithm.
     
    293293
    294294
    295 === `U_global2local_state` (global2local_state.F90) ===
     295=== `U_global2local_state` (global2local_state_pdaf.F90) ===
    296296
    297297This routine is used by all filter algorithms with domain-localization (LSEIK, LETKF) and is independent of the particular algorithm.
     
    315315
    316316
    317 === `U_local2global_state` (local2global_state.F90) ===
     317=== `U_local2global_state` (local2global_state_pdaf.F90) ===
    318318
    319319This routine is used by all filter algorithms with domain-localization (LSEIK, LETKF) and is independent of the particular algorithm.
     
    337337
    338338
    339 === `U_global2local_obs` (global2local_obs.F90) ===
     339=== `U_global2local_obs` (global2local_obs_pdaf.F90) ===
    340340
    341341This routine is used by all filter algorithms with domain-localization (LSEIK, LETKF) and is independent of the particular algorithm.
     
    360360
    361361
    362 === `U_init_obsvar` (init_obsvar.F90) ===
     362=== `U_init_obsvar` (init_obsvar_pdaf.F90) ===
    363363
    364364This routine is used by the global filter algorithms SEIK and  ETKF as well as the local filters LSEIK and LETKF. The routine is only called if the adaptive forgetting factor is used (`type_forget=1` in the example implementation). The difference in this routine between global and local filters is that the global filters use 'global' while the local filters use 'full' quantities.
     
    384384
    385385
    386 === `U_init_obsvar_local` (init_obsvar_local.F90) ===
     386=== `U_init_obsvar_local` (init_obsvar_local_pdaf.F90) ===
    387387
    388388This routine is used by all filter algorithms with domain-localization (LSEIK, LETKF) and is independent of the particular algorithm. The routine is only called if the local adaptive forgetting factor is used (`type_forget=2` in the example implementation).
     
    409409
    410410Before the analysis step is called the following is executed:
    411  1. [#U_collect_statecollect_state.F90 U_collect_state] (called once for each ensemble member)
     411 1. [#U_collect_statecollect_state_pdaf.F90 U_collect_state] (called once for each ensemble member)
    412412
    413413When the ensemble integration of the forecast is completed, the analysis step is executed. Before the loop over all local analysis domains, the following routines are executed:
    414  1. [#U_prepoststepprepoststep_seik.F90 U_prepoststep] (Call to act on the forecast ensemble, called with negative value of the time step)
    415  1. [#U_init_n_domainsinit_n_domains.F90 U_init_n_domains]
    416  1. [#U_init_dim_obs_fullinit_dim_obs_full.F90 U_init_dim_obs_full]
    417  1. [#U_obs_op_fullobs_op_full.F90 U_obs_op_full] (Called `dim_ens` times; once for each ensemble member)
    418  1. [#U_init_obs_fullinit_obs_full.F90 U_init_obs_full] (Only executed, if the global adaptive forgetting factor is used (`type_forget=1` in the example implemention))
    419  1. [#U_init_obsvarinit_obsvar.F90 U_init_obsvar] (Only executed, if the global adaptive forgetting factor is used (`type_forget=1` in the example implemention))
     414 1. [#U_prepoststepprepoststep_seik_pdaf.F90 U_prepoststep] (Call to act on the forecast ensemble, called with negative value of the time step)
     415 1. [#U_init_n_domainsinit_n_domains_pdaf.F90 U_init_n_domains]
     416 1. [#U_init_dim_obs_fullinit_dim_obs_full_pdaf.F90 U_init_dim_obs_full]
     417 1. [#U_obs_op_fullobs_op_full_pdaf.F90 U_obs_op_full] (Called `dim_ens` times; once for each ensemble member)
     418 1. [#U_init_obs_fullinit_obs_full_pdaf.F90 U_init_obs_full] (Only executed, if the global adaptive forgetting factor is used (`type_forget=1` in the example implemention))
     419 1. [#U_init_obsvarinit_obsvar_pdaf.F90 U_init_obsvar] (Only executed, if the global adaptive forgetting factor is used (`type_forget=1` in the example implemention))
    420420
    421421In the loop over all local analysis domains, it is executed for each local analysis domain:
    422  1. [#U_init_dim_localinit_dim_local.F90 U_init_dim_local]
    423  1. [#U_init_dim_obs_localinit_dim_obs_local.F90 U_init_dim_obs_local]
    424  1. [#U_global2local_stateglobal2local_state.F90 U_global2local_state] (Called `dim_ens+1` times: Once for each ensemble member and once for the mean state estimate)
    425  1. [#U_global2local_obsglobal2local_obs.F90 U_global2local_obs] (A single call to localize the mean observed state)
    426  1. [#U_init_obs_localinit_obs_local.F90 U_init_obs_local]
    427  1. [#U_global2local_obsglobal2local_obs.F90 U_global2local_obs] (`dim_ens` calls: one call to localize the observed part of each ensemble member)
    428  1. [#U_init_obsvar_localinit_obsvar_local.F90 U_init_obsvar_local] (Only called, if the local adaptive forgetting factor is used (`type_forget=2` in the example implementation))
    429  1. [#U_prodRinvA_localprodrinva_local.F90 U_prodRinvA_local]
    430  1. [#U_local2global_statelocal2global_state.F90 U_local2global_state] (Called `dim_ens+1` times: Once for each ensemble member and once for the mean state estimate)
     422 1. [#U_init_dim_localinit_dim_local_pdaf.F90 U_init_dim_local]
     423 1. [#U_init_dim_obs_localinit_dim_obs_local_pdaf.F90 U_init_dim_obs_local]
     424 1. [#U_global2local_stateglobal2local_state_pdaf.F90 U_global2local_state] (Called `dim_ens+1` times: Once for each ensemble member and once for the mean state estimate)
     425 1. [#U_global2local_obsglobal2local_obs_pdaf.F90 U_global2local_obs] (A single call to localize the mean observed state)
     426 1. [#U_init_obs_localinit_obs_local_pdaf.F90 U_init_obs_local]
     427 1. [#U_global2local_obsglobal2local_obs_pdaf.F90 U_global2local_obs] (`dim_ens` calls: one call to localize the observed part of each ensemble member)
     428 1. [#U_init_obsvar_localinit_obsvar_local_pdaf.F90 U_init_obsvar_local] (Only called, if the local adaptive forgetting factor is used (`type_forget=2` in the example implementation))
     429 1. [#U_prodRinvA_localprodrinva_local_pdaf.F90 U_prodRinvA_local]
     430 1. [#U_local2global_statelocal2global_state_pdaf.F90 U_local2global_state] (Called `dim_ens+1` times: Once for each ensemble member and once for the mean state estimate)
    431431
    432432After the loop over all local analysis domains, it is executed:
    433  1. [#U_prepoststepprepoststep_seik.F90 U_prepoststep] (Call to act on the analysis ensemble, called with (positive) value of the time step)
    434 
    435 
    436 
     433 1. [#U_prepoststepprepoststep_seik_pdaf.F90 U_prepoststep] (Call to act on the analysis ensemble, called with (positive) value of the time step)
     434
     435
     436