Changes between Version 9 and Version 10 of ImplementGenerateObs
- Timestamp:
- Nov 30, 2020, 1:14:31 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ImplementGenerateObs
v9 v10 3 3 [[PageOutline(2-3,Contents of this page)]] 4 4 5 The observation generation functionality was added with Version 1.14 of PDAF. 5 The observation generation functionality was added with Version 1.14 of PDAF. Here we describe the implementation using PDAF-OMI that was introduced with PDAF version 1.16. (The older implementation variant is documented on the page on [wiki:ImplementGenerateObs_noOMI Implementation of Observation Generation without OMI].) 6 6 7 7 == Overview == … … 25 25 This step replaces the analysis step. The implementation is analogous to implementing the analysis step as described on the [wiki:ImplementationofAnalysisStep page on implementing the analysis step]. 26 26 27 == `PDAF _generate_obs` ==27 == `PDAFomi_generate_obs` == 28 28 29 This routine is used in the same way as the filter specific routines `PDAF _assimilate_*`. Thus the general aspect have been described on the page [ModifyModelforEnsembleIntegration Modification of the model code for the ensemble integration] and its sub-page on [InsertAnalysisStep inserting the analysis step]. The routine `PDAF_generate_obs` is used in the fully-parallel implementation variant of the data assimilation system. When the 'flexible' implementation variant is used, the routines `PDAF_put_state_generate_obs' is used as described further below. Here, we list once more the full interface. Subsequently, the full set of user-supplied routines specified in the call to `PDAF_generate_obs` is explained. Apart from two call-back routines, the routines are idnetical to e.g. those used for the LESTKF and LETKFfilters.29 This routine is used in the same way as the filter specific routines `PDAFomi_assimilate_*`. Thus the general aspect have been described on the page [ModifyModelforEnsembleIntegration Modification of the model code for the ensemble integration] and its sub-page on [InsertAnalysisStep inserting the analysis step]. The routine `PDAFomi_generate_obs` is used in the fully-parallel implementation variant of the data assimilation system. When the 'flexible' implementation variant is used, the routines `PDAFomi_put_state_generate_obs' is used as described further below. Here, we list once more the full interface. Subsequently, the full set of user-supplied routines specified in the call to `PDAFomi_generate_obs` is described. Apart from two call-back routines, the routines are identical to e.g. those used for the local filters. 30 30 31 31 {{{ 32 32 SUBROUTINE PDAF_generate_obs(U_collect_state, U_distribute_state, & 33 U_init_dim_obs _f, U_obs_op_f, U_init_obserr_f, U_get_obs_f, &33 U_init_dim_obs, U_obs_op, U_get_obs_f, & 34 34 U_prepoststep, U_next_observation, status_pdaf) 35 35 }}} … … 37 37 * `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] 38 38 * `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. 39 * `U_init_dim_obs_f`: The name of the user-supplied routine that provides the size of the full observation vector 40 * `U_obs_op_f`: The name of the user-supplied routine that acts as the full observation operator on some state vector 41 * `U_init_obserr_f`: The name of the user-supplied routine that initializes the vector of observations error standard deviations for full observation vector 39 * `U_init_dim_obs`: The name of the user-supplied routine that provides the size of the full observation vector 40 * `U_obs_op`: The name of the user-supplied routine that acts as the full observation operator on some state vector 42 41 * `U_get_obs_f`: The name of the user-supplied routine that receives the full vector of generated synthetic observations from PDAF 43 42 * `U_prepoststep`: The name of the pre/poststep routine as in `PDAF_get_state` … … 46 45 47 46 48 == `PDAF _put_state_generate_obs` ==47 == `PDAFomi_put_state_generate_obs` == 49 48 50 When the 'flexible' implementation variant is chosen for the assimilation system, the routine `PDAF _put_state_generate_obs` has to be used instead of `PDAF_generate_obs`. 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_generate_obs` with the exception the specification of the user-supplied routines `U_distribute_state` and `U_next_observation` are missing.49 When the 'flexible' implementation variant is chosen for the assimilation system, the routine `PDAFomi_put_state_generate_obs` has to be used instead of `PDAFomi_generate_obs`. The general aspects of the filter specific routines `PDAFomi_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 `PDAFomi_generate_obs` with the exception the specification of the user-supplied routines `U_distribute_state` and `U_next_observation` are missing. 51 50 52 51 The interface is the following: 53 52 {{{ 54 SUBROUTINE PDAF _put_state_generate_obs(U_collect_state, U_init_dim_obs_f, U_obs_op_f, U_init_obserr_f, &53 SUBROUTINE PDAFomi_put_state_generate_obs(U_collect_state, U_init_dim_obs, U_obs_op, & 55 54 U_get_obs_f, U_prepoststep, status_pdaf) 56 55 }}} … … 77 76 78 77 79 === `U_init_dim_obs _f` (init_dim_obs_f_pdaf.F90) ===78 === `U_init_dim_obs` (callback_obs_pdafomi.F90) === 80 79 81 Th is routine has to initialize the size `dim_obs_f` of the full observation vector according to the current time step. For simplicity, `dim_obs_f` can be the size for the global model domain. The routine is described in detail on the [wiki:ImplementAnalysislestkf page on implementing the analysis step for LESKTF].80 The routine is called at the beginning of each analysis step. For PDAF, it has to initialize the size `dim_obs_p` of the observation vector according to the current time step. Apart from this routine will initialize overall observation information. In this routine one just calls `init_dim_obs_TYPE` for each observation type. The routine is described in detail on [wiki:OMI_Callback_obs_pdafomi callback_obs_pdafomi.F90]. 82 81 83 === `U_obs_op_f` (obs_obs_f_pdaf.F90) ===84 82 85 This routine has to perform the operation of the observation operator acting on a state vector, which is provided as `state_p`. The observed state has to be returned in `m_state_f`. It is the observed state corresponding to the 'full' observation vector. The routine is described in detail on the [wiki:ImplementAnalysislestkf page on implementing the analysis step for LESKTF]. 83 === `U_obs_op` (callback_obs_pdafomi.F90) === 86 84 87 === `U_init_obserr_f` (init_obserr_f_pdaf.F90) === 85 The routine is called during the analysis step. It has to perform the operation of the observation operator acting on a state vector that is provided as `state_p`. The observed state has to be returned in `m_state_p`. In this routine one just calls `obs_op_TYPE` for each observation type. The routine is described in detail on [wiki:OMI_Callback_obs_pdafomi callback_obs_pdafomi.F90]. 88 86 89 This routine is specific for the observation generation. The routine is called by PDAF during the observation generation. Its purpose is to fill the provided vector of observation error standard deviations.90 91 The interface is the following:92 {{{93 SUBROUTINE init_obserr_f_pdaf(step, dim_obs_f, obs_f, rms_obs)94 }}}95 with96 * `step` : `integer, intent(in)`[[BR]] Current time step97 * `dim_obs_f` : `integer, intent(in)`[[BR]] Size of full observation vector98 * `obs_f` : `real, intent(in), dimension(dim_obs_f)`[[BR]] Full vector of observations99 * `rms_obs` : `real, intent(out), dimension(dim_obs_f)`[[BR]] Full vector of observation error standard deviations100 101 Notes:102 * The routines handles the 'full' observation vector as in localizated filters. As described for the observation generation functionality one can also use it for global filters. In this case the 'full' vector would just contain the observations local to a process sub-domain.103 * The observation vector `obs_f` is provided to the routine for the case that the observation error is relative to the value of the observations.104 87 105 88 === `U_get_obs_f` (get_obs_f_pdaf.F90) === … … 132 115 133 116 134 == Recommendations for using `PDAF _generate_obs` ==117 == Recommendations for using `PDAFomi_generate_obs` == 135 118 136 The observation-generation with `PDAF _generate_obs` or `PDAF_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 routine `init_dim_obs_f_pdaf` can be identical to the actuall assimilation case. It initializes the full observation dimension and usually also some more observation information (as described e.g. on the [wikio:init_dim_obs_f_pdaf detail page on init_dim_obs_f_pdaf]. Subsequently `obs_op_f_pdaf` is applied. One 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 routine `init_obserr_f_pdaf` provides PDAF with the vector of observation error standard deviations. This 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).119 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. 137 120 138 If one has access to real observations, one can use the implementation of `init_dim_obs_f_pdaf` and `obs_ob_f_pdaf` for these observations to generate synthetic observations simulating these real observations. Thus one runs the observation generation using these routines without any modifications. 121 One 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). 122 123 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. 124 125 '''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. 139 126 140 127 141 128 == Using the synthetic observations in twin experiments == 142 129 143 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 routine `init_dim_obs_f` one only needs to small modification of this routine. Namely, only required modification is that at the end of `init_dim_obs_f` 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_f` to overwrite the observatio 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.130 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. 144 131 145 Example implementations using `PDAF _put_state_generate_obs` and `readwrite_obs.F90` are provided by the two test cases `testsuite/src/dummymodel_1D` and `testsuite/src/lorenz96`. These also use the flag `twin_experiment` to actiavate the twin experiment (Note: These two test cases always use simulated observations. Nonetheless, they allow to see how the synthetic observations are generated with PDAF and how they are used in a twin experiment).132 Example implementations using `PDAFomi_put_state_generate_obs` and `readwrite_obs.F90` are provided by the test case `testsuite/src/lorenz96_omi`. These also use the flag `twin_experiment` to activate the twin experiment (Note: These two test cases always use simulated observations. Nonetheless, they allow to see how the synthetic observations are generated with PDAF and how they are used in a twin experiment). 146 133