Changes between Version 3 and Version 4 of ImplementGenerateObs_PDAF3


Ignore:
Timestamp:
Jun 3, 2025, 10:54:13 AM (3 days ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ImplementGenerateObs_PDAF3

    v3 v4  
    1919The implementation of the initialization of PDAF is explained on the [wiki:OnlineInitPdaf_PDAF3 page on 'init_pdaf' and 'PDAF_init'].
    2020
    21 For the observation generation one just has to set `filtertype = PDAF_DA_GENOBS` or `filtertype = 100`.
     21For the observation generation one just has to set `filtertype = PDAF_DA_GENOBS`  or `filtertype = 100` as argument to `PDAF_init`.
    2222
    2323To set options, using the common names in the tutorial and template codes, for `filter_param_i` one just has to specify the mandatory values of the state dimension and the ensemble size. For `filter_param_r` one has to specify the mandatory values of the forgetting factor (even though, this value is ignored for the observation generation).
     
    3030This step replaces the analysis step. The implementation is analogous to implementing the analysis step as described on the [wiki:ImplementationofAnalysisStep_PDAF3 page on implementing the analysis step].
    3131
    32 The observation generation is always run with ensemble size 1.
     32The observation generation is only available in PDAF's online mode.
    3333
    34 == `PDAFomi_generate_obs` ==
     34== `PDAF3_generate_obs` ==
    3535
    3636This routine is used in the same way as the analysis routine `PDAF3_assimilate`. This routine can be used in both the ''fully-parallel'' and the ''flexible'' implementation variants of the data assimilation system. (See the page [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3 Modification of the model code for the ensemble integration] for these variants).
     
    9090This routine is independent of the filter algorithm used.
    9191
    92 See the page on [ModifyModelforEnsembleIntegration#collect_state_pdafcollect_state_pdaf.F90 modifying the model code for the ensemble integration] for the description of this routine.
     92See the page on [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3#collect_state_pdafcollect_state_pdaf.F90 modifying the model code for the ensemble integration] for the description of this routine.
    9393
    9494=== `distribute_state_pdaf` (distribute_state_pdaf.F90) ===
     
    9696This routine is independent of the filter algorithm used.
    9797
    98 See the page on [ModifyModelforEnsembleIntegration#distribute_state_pdafdistribute_state_pdaf.F90 modifying the model code for the ensemble integration] for the description of this routine.
     98See the page on [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3#distribute_state_pdafdistribute_state_pdaf.F90 modifying the model code for the ensemble integration] for the description of this routine.
    9999
    100100=== `init_dim_obs_pdafomi` (callback_obs_pdafomi.F90) ===
     
    113113=== `get_obs_f_pdaf` (get_obs_f_pdaf.F90) ===
    114114
    115 This routine is specific for the observation generation. PDAF provides to this routine the vector of synthetic observations generated by PDAF. One can then, e.g., write the observation vector into a file so that one can use it later in a twin experiment (The template file `readwrite_obs.F90` provides functionality for reading and writing as described on the [wiki:readwrite_obs page on readwrite_obs].
     115This routine is specific for the observation generation. PDAF provides to this routine the vector of synthetic observations generated by PDAF. One can then, e.g., write the observation vector into a file so that one can use it later in a twin experiment (The template file `readwrite_obs.F90` provides functionality for reading and writing as described on the [wiki:readwrite_obs page on readwrite_obs].)
    116116
    117117The interface is the following:
     
    125125
    126126Hints:
    127  * For the generation of synthetic observations, PDAF does not distinguish between local and global filters. Without parallelization, the full observation vector would be the same for both types of filters. With parallelization the implementation of the observation operator used for generating the observations will define whether different process-domain have the same or distinct observation vectors (i.e. covering the global domain or different process-specific domains).
    128  * In case of the global filters, one uses the functionality of the observation operator for this filter type. With parallelization, the observation operator will initialize an observation vector specifically for each process-domain.
    129  * The usual operation performed in this routine is to write the generated synthetic observation into a file. The PDAF package provides the template routine [wiki:readwrite_obs readwrite_obs] for this. Depending on the parallelization, discussed above, one either writes a single file (of the full observation vector is the same for all processes. In this case one a single process calls the writing routine) or a different file for each process (in this case, each process call the routine with a different file name; usually indicating the process-rank number).
     127 * For generating synthetic observations, PDAF does not apply any data assimilation, but just calls the observation routines. The returned observation vector is for the global domain is no parallelization is used. If parallelization is used with a domain decomposition, the observation operator used for generating the observations will define whether different process-domain have the same or distinct observation vectors (i.e. covering the global domain or different process-specific domains). The observation operators provided with PDAF-OMI return the observations for a sub-domain.
     128 * The usual operation performed in this routine is to write the generated synthetic observation into a file. The PDAF package provides the template routine [wiki:readwrite_obs readwrite_obs] for this. Depending on the parallelization, discussed above, one either writes a single file or a different file for each process (in this case, each process call the routine with a different file name; usually indicating the process-rank number).
    130129
    131130
    132 === `U_prepoststep` (prepoststep_ens_pdaf.F90) ===
     131=== `prepoststep_pdaf` (prepoststep_ens_pdaf.F90) ===
    133132
    134 This routine can be identical to that used for the global ESTKF algorithm, which has already been described on the [ModifyModelforEnsembleIntegration#U_prepoststepprepoststep_ens.F90 page on modifying the model code for the ensemble integration].
     133The routine has already been described for modifying the model for the ensemble integration and for inserting the analysis step.
    135134
    136 === `U_next_observation` (next_observation_pdaf.F90) ===
     135See the page on [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3#distribute_state_pdafdistribute_state_pdaf.F90 modifying the model code for the ensemble integration] for the description of this routine.
     136
     137
     138=== `next_observation_pdaf` (next_observation_pdaf.F90) ===
    137139
    138140This routine is independent of the filter algorithm used.
    139 See the page on [InsertAnalysisStep#U_next_observationnext_observation_pdaf.F90 inserting the analysis step] for the description of this routine.
     141
     142See the page on [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3#distribute_state_pdafdistribute_state_pdaf.F90 modifying the model code for the ensemble integration] for the description of this routine.
    140143
    141144
    142 == Recommendations for using `PDAFomi_generate_obs` ==
     145== Recommendations for using `PDAF3_generate_obs` ==
    143146
    144 The observation-generation with `PDAFomi_generate_obs` or `PDAFomi_put_state_generate_obs` works analogously to the observation handling in the localized filters like LESTKF and LETKF. However, the observation generation does not modify the ensemble states and `prepoststep_pdaf` is only called once before the each observation generation, but not afterwards. The usual observation functionality of `init_dim_obs_pdafomi` and `obs_op_pdafomi` is used to obtain the observed model state.
     147The observation-generation with `PDAF3_generate_obs` or `PDAF3_put_state_generate_obs` works analogously to the observation handling in ensemble filters. However, the observation generation does not modify the ensemble states and `prepoststep_pdaf` is only called once before the each observation generation, but not afterwards. The usual observation functionality of `init_dim_obs_pdafomi` and `obs_op_pdafomi` is used to obtain the observed model state.
    145148
    146149One can run the ensemble generation with a single ensemble member (dim_ens=1) or a larger ensemble. If dim_ens>1, the observation operator is applied to the ensemble mean state. The observation error information initialized in `init_dim_obs_pdafomi` is used in combination with Gaussian random noise to compute the perturbations that are added to the true state to generate the observations. Finally `get_obs_f_pdaf` gives the user access to the generated synthetic observation vector so that one can write it to a file for later use (See the [wiki:readwrite_obs page on the template file readwrite_obs.F90] for a description how the observations can be written to a file and used later on).
    147150
    148 If one has access to real observations, one can use the implementation of `init_dim_obs_pdafomi` and `obs_ob_pdafomi` for these observations to generate synthetic observations simulating these real observations. Thus, one runs the observation generation using these routines without any modifications. 
     151If one has access to real observations, one can use the implementation of `init_dim_obs_pdafomi` and `obs_ob_pdafomi` for these observations to generate synthetic observations simulating these real observations. Thus, one runs the observation generation using these routines without any modifications.
    149152
    150 '''Note:''' The observation generation should always be performed for a single observation type at a time. Thus one generates separate observation files for each observation type.
     153'''Note:''' The observation generation should always be performed for a single observation type at a time. Thus, one generates separate observation files for each observation type.
    151154
    152155
    153156== Using the synthetic observations in twin experiments ==
    154157
    155 To perform a twin experiment using the synthetic observations generated by PDAF, one runs the data assimilation as one would with real observations. If one already initializes the vector of actual observations in the routines `init_dim_obs_TYPE` in the observation modules one only needs a small modification of this routine. Namely, the only required modification is that at the end of `init_dim_obs_TYPE` one overwrites the vector of real observations with the values from the synthetic observations. If one uses the template file `readwrite_obs.F90` for this, one can use `read_syn_obs` from this file at the end of `init_dim_obs_TYPE` to overwrite the observation vector. To allow for a flexible switching between the case using real observations and the twin experiment, one can for example introduce a flag `twin_experiment` that controls whether the real observation values are overwritten. This reading is already included, but out-commented, in the templates.
     158To perform a twin experiment using the synthetic observations generated by PDAF, one runs the data assimilation as one would with real observations. If one already initializes the vector of actual observations in the routines `init_dim_obs_OBSTYPE` in the observation modules, one only needs a small modification of this routine. Namely, the only required modification is that at the end of `init_dim_obs_OBSTYPE`: Here, one overwrites the vector of real observations with the values from the synthetic observations. If one uses the template file `readwrite_obs.F90` for this, one can use `read_syn_obs` from this file at the end of `init_dim_obs_OBSTYPE` to overwrite the observation vector. To allow for a flexible switching between the case using real observations and the twin experiment, one can, for example, introduce a flag `twin_experiment` that controls whether the real observation values are overwritten. This reading is already included, but out-commented, in the templates.
    156159
    157 Example implementations using `PDAFomi_put_state_generate_obs` and `readwrite_obs.F90` are provided by the implementation of PDAF with the Lorenz-96 model in `models/lorenz96/`. These also use the flag `twin_experiment` to activate the twin experiment (Note: The Lorenz-96 model case always use simulated observations. Nonetheless, it allows to see how the synthetic observations are generated with PDAF and how they are used in a twin experiment).
     160Example implementations using `PDAF3_put_state_generate_obs` and `readwrite_obs.F90` are provided by the implementation of PDAF with the Lorenz-96 model in `models/lorenz96/`. These also use the flag `twin_experiment` to activate the twin experiment (Note: The Lorenz-96 model case always use simulated observations. Nonetheless, it allows to see how the synthetic observations are generated with PDAF and how they are used in a twin experiment).
    158161