Changes between Version 1 and Version 2 of ImplementAnalysisUniversal


Ignore:
Timestamp:
May 19, 2025, 6:22:21 PM (13 days ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ImplementAnalysisUniversal

    v1 v2  
    119119== User-supplied routines ==
    120120
    121 Here, all user-supplied routines are described that are required in the call to `PDAFlocalomi_assimilate` or `PDAFlocalomi_put_state`. For some of the generic routines, we link to the page on [ModifyModelforEnsembleIntegration modifying the model code for the ensemble integration].
     121Here, all user-supplied routines are described that are required in the call to `PDAF3_assimilate`, `PDAF3_assim_offline` or `PDAF3_put_state`. For some of the generic routines, we link to the page on [ModifyModelforEnsembleIntegration modifying the model code for the ensemble integration].
    122122
    123123To indicate user-supplied routines we use the prefix `U_`. In the tutorials in `tutorial/` and in the template directory `templates/` these routines exist without the prefix, but with the extension `_pdaf`. The files are named correspondingly. The user-routines relating to OMI are collected in the file callback_obs_pdafomi.F90. In the section titles below we provide the name of the template file in parentheses.
     
    142142=== `U_init_dim_obs_pdafomi` (callback_obs_pdafomi.F90) ===
    143143
    144 This 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.
     144This is a call-back routine initializing the observation information. The routine just calls a routine from the observation module for each observation type.
    145145
    146146See the [wiki:OMI_Callback_obs_pdafomi documentation on callback_obs_pdafomi.F90] for more information.
     
    150150=== `U_obs_op_pdafomi` (callback_obs_pdafomi.F90) ===
    151151
    152 This 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.
     152This is a call-back routine applying the observation operator to the state vector. The routine calls a routine from the observation module for each observation type.
    153153
    154154See the [wiki:OMI_Callback_obs_pdafomi documentation on callback_obs_pdafomi.F90] for more information.
     
    177177
    178178Hints:
    179  * As a simple case, if the localization is only performed horizontally, the local analysis domains can be single vertical columns of the model grid. In this case, `n_domains_p` is simply the number of vertical columns in the local model sub-domain.
     179 * As a simple case, if the localization is only performed horizontally, the local analysis domains can be single vertical columns of the model grid. In this case, `n_domains_p` is simply the number of vertical columns in the process-local model sub-domain.
    180180
    181181
     
    194194For PDAF it has to provide in `dim_l` the dimension of the state vector for the local analysis domain with index `domain_p`.
    195195
    196 In addition, for PDAFlocal the routine has to provide the index array containing the indices of the elements of the local state vector in the global (or domain-decomposed) state vector to PDAFlocal by calling `PDAFlocal_set_indices`. (in the template files, this array is called `id_lstate_in_pstate`)
     196In addition, the routine has to provide the index array containing the indices of the elements of the local state vector in the global (or domain-decomposed) state vector to PDAF by calling `PDAFlocal_set_indices`. (in the template files, this array is called `id_lstate_in_pstate`)
     197
     198Finally, in the tutorial and template codes, the routine initializes an array `coords_l` containing the coordinates that describe the local domain. This is shared with `U_init_dim_obs_l_pdafomi` via the module `mod_assimilation`.
    197199
    198200Hints:
    199  * For sharing through the module `mod_assimilation`, we further initialize an array `coords_l` containing the coordinates that describe the local domain.
    200   * These coordinates have to describe one location in space that is used in the OMI observation modules to compute the distance from observations.
     201  * The coordinates in `coords_l` have to describe one location in space that is used for localization to compute the distance from observations.
    201202  * The coordinates in `coords_l` have the same units as those used for the observations
    202203  * For geographic distance computations, the unit of the coordinates needs to be radian, thus (0, 2*pi) or (-pi,pi) for longitude and (-pi/2, pi/2) for latitude.
     
    207208   * In this case only the horizontal coordinates are used in `coords_l`.
    208209
    209 The index array `id_lstate_in_pstate` is an integer array in form of a one-dimensional vector. One initializes this vector by determining the indices of the elements of the local state vector in the global, or domain decomposed, state vector. After initializing `id_lstate_in_pstate`, one has to provided it to PDAFlocal by calling `PDAFlocal_set_indices'. The interface interface is:
     210The index array `id_lstate_in_pstate` is an integer array in form of a one-dimensional vector. One initializes this vector by determining the indices of the elements of the local state vector in the global, or domain decomposed, state vector. After initializing `id_lstate_in_pstate`, one has to provided it to PDAF by calling `PDAFlocal_set_indices'. The interface interface is:
    210211
    211212{{{
     
    237238== Execution order of user-supplied routines ==
    238239
    239 The user-supplied routines are executed in the order listed below. The order can be important as some routines can perform preparatory work for routines executed later on during the analysis. For example, `U_init_dim_l` can prepare an index array that provides the information how to localize a global state vector. Some hints one the efficient implementation strategy are given with the descriptions of the routine interfaces above.
     240The user-supplied routines are executed in the order listed below. The order can be important as some routines can perform preparatory work for routines executed later on during the analysis. For example, in `U_init_dim_l` we can prepare the index array that provides the information how to localize a global state vector.
    240241
    241242Before the analysis step is called the following is executed:
    242243 1. [#U_collect_statecollect_state_pdaf.F90 U_collect_state] (called once for each ensemble member)
    243 
    244 When 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:
    245244 1. [#U_prepoststepprepoststep_ens_pdaf.F90 U_prepoststep] (Call to act on the forecast ensemble, called with negative value of the time step)
    246  1. [#U_init_n_domainsinit_n_domains_pdaf.F90 U_init_n_domains]
     245
     246At the analysis time, the observations are initialized by the routines:
    247247 1. [#U_init_dim_obs_pdafomicallback_obs_pdafomi.F90 U_init_dim_obs_pdafomi]
    248248 1. [#U_obs_op_pdadfomicallback_obs_pdafomi.F90 U_obs_op_pdafomi] (Called `dim_ens` times; once for each ensemble member)
     249
     250Now the analysis step is entered and the number of local analysis domain is initialized by calling:
     251 1. [#U_init_n_domainsinit_n_domains_pdaf.F90 U_init_n_domains]
    249252
    250253In the loop over all local analysis domains, it is executed for each local analysis domain:
     
    255258 1. [#U_prepoststepprepoststep_ens_pdaf.F90 U_prepoststep] (Call to act on the analysis ensemble, called with (positive) value of the time step)
    256259
    257 In case of the routine `PDAFomi_assimilate_local`, the following routines are executed after the analysis step:
     260In case of the routine `PDAF3_assimilate`, the following routines are executed after the analysis step:
    258261 1. [#U_distribute_statedistribute_state_pdaf.F90 U_distribute_state]
    259262 1. [#U_next_observationnext_observation_pdaf.F90 U_next_observation]