35 | | This page describes the recommended implementation of the analysis step for the parameterized 3D-Var using the particular interface routines. |
36 | | |
37 | | || |
38 | | |
39 | | There are genenerally three different variants of 3D-Var provided by PDAF: parameterized 3D-Var, 3D Ensemble Var, and hybrid (parameterized + ensemble) 3D-Var. All can be called using the universal interface routines described here. |
40 | | |
41 | | For the analysis step of 3D-Var we need different operations related to the observations. These operations are requested by PDAF by call-back routines supplied by the user and provided in the OMI structure. The names of the routines that are provided by the user are specified in the call to the routine `PDAF3_assimilate_3dvar_all` in the online mode of PDAF or `PDAF3_assim_offline_3dvar_all` for the offline mode. With regard to the parallelization, all these routines (except `collect_state_pdaf`, `distribute_state_pdaf`, and `next_observation_pdaf`) are executed by the filter processes (`filterpe=.true.`) only. |
42 | | |
43 | | The universal interface has more arguments than the specific interfaces for the parameterized 3D-Var or the 3D ensemble Var methods. It is useful if one implements both the 3D-Var with parameterized covariances and rhe 3D ensemble Var. The hybrid 3D-Var using the LESTKF is always called using this unversal interface. |
44 | | |
45 | | The different 3D-Var methods in PDAF were explained on the [wiki:Implement3DVarAnalysisOverview page providing the verview of the Analysis Step for 3D-Var Methods]. Depending the type of 3D-Var, the background covariance matrix '''B''' is represented either in a parameterized form, by an ensemble, or by a combination of both. The 3D-Var methods that use an ensemble need to transform the ensemble perturbations using an ensemble Kalman filter. PDAF uses for this the error-subspace transform filter ESTKF. There are two variants: The first uses the localized filter LESTKF, while the second uses the global filter ESTKF. |
46 | | |
47 | | For completeness we discuss here all user-supplied routines that are specified in the interface to `PDAFomi_assimilate_hyb3dvar_X`. Thus, some of the user-supplied routines that are explained on the page describing the modification of the model code for the ensemble integration are repeated here. |
48 | | |
49 | | == `PDAFomi_assimilate_3dvar` == |
50 | | |
51 | | This routine is used both in the ''fully-parallel'' and the ''flexible'' implementation variants of the data assimilation system. (See the page [OnlineModifyModelforEnsembleIntegration_PDAF3 Modification of the model code for the ensemble integration] for these variants) |
52 | | |
53 | | The interface for using the parameterized 3D-Var is: |
| 35 | This page describes the implementation of the analysis step for the parameterized 3D-Var using the particular interface routines. |
| 36 | |
| 37 | || The interface routines for the parameterized 3D-Var are specialized versions of the universal interface with a reduced number of arguments. If one implements both 3D Ensemble Var and parameterlized 3D-Var we recommend to use the [wiki:Implement3DVarAnalysisPDAF3Universal universal interface routines for 3D-Var]. || |
| 38 | |
| 39 | The different 3D-Var methods in PDAF were explained on the [wiki:Implement3DVarAnalysisOverviewPDAF3 page providing the verview of the Analysis Step for 3D-Var Methods]. Depending the type of 3D-Var, the background covariance matrix '''B''' is represented either in a parameterized form, by an ensemble, or by a combination of both. The 3D-Var methods that use an ensemble need to transform the ensemble perturbations using an ensemble Kalman filter. |
| 40 | |
| 41 | For the analysis step of 3D-Var we need different operations related to the observations. These operations are requested by PDAF by call-back routines supplied by the user and provided in the PDAF-OMI structure. in the call to the assimilation routines as was examplained on the [wiki:Implement3DVarAnalysisOverviewPDAF3 page providing the verview of the Analysis Step for 3D-Var Methods]. |
| 42 | |
| 43 | For completeness we discuss here all user-supplied routines that are specified as arguments. Thus, some of the user-supplied routines, which were explained on the page describing the modification of the model code for the ensemble integration, are repeated here. |
| 44 | |
| 45 | |
| 46 | == AssimilationRoutines == |
| 47 | |
| 48 | The general aspects of the filter (or solver) specific routines for the 3D-Var analysis step have been described on the page [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3 Modification of the model code for the ensemble integration]. Here, we list the full interface of the routine. Subsequently, the user-supplied routines specified in the call is explained. |
| 49 | |
| 50 | === `PDAF3_assimilate_3dvar` === |
| 51 | |
| 52 | This routine is used both in 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) |
| 53 | |
| 54 | The interface is: |
75 | | == `PDAF3_assim_offline_3dvar` == |
76 | | |
77 | | This routine is used to perform the analysi step for the offline mode of PDAF. |
78 | | The interface of the routine is identical with that of `PDAF3_assimilate_3dvar`, except that the user-supplied routines `U_distribute_state`, `U_collect_state` and `U_next_observation` are missing. |
| 76 | === `PDAF3_assim_offline_3dvar` === |
| 77 | |
| 78 | This routine is used to perform the analysis step for the offline mode of PDAF. |
| 79 | The interface of the routine is identical with that of `PDAF3_assimilate_3dvar`, except that the user-supplied routines `distribute_state_pdaf`, `collect_state` and `next_observation_pdaf` are missing. |
90 | | == `PDAF3_put_state_3dvar` == |
91 | | |
92 | | This routine exists for backward-compatibility. In implementations that were done before the release of PDAF V3.0, a 'put_state' routine was used for the `flexible` parallelization variant and for the offline mode. |
93 | | When the 'flexible' implementation variant is chosen for the assimilation system, the routine. This routine allows to port such implementations to the PDAF3 interface with minimal changes. |
94 | | The interface of the routine is identical with that of `PDAF3_assimilate_3dvar`, except that the user-supplied routines `U_distribute_state` and `U_next_observation` are missing. |
| 91 | === `PDAF3_put_state_3dvar` === |
| 92 | |
| 93 | This routine exists for backward-compatibility. In implementations that were done before the release of PDAF V3.0, a 'put_state' routine was used for the ''flexible'' parallelization variant and for the offline mode. |
| 94 | When the ''flexible'' implementation variant is chosen for the assimilation system, the routine. This routine allows to port such implementations to the PDAF3 interface with minimal changes. |
| 95 | The interface of the routine is identical with that of `PDAF3_assimilate_3dvar`, except that the user-supplied routines `distribute_state_pdaf` and `next_observation_pdaf` are missing. |
108 | | Here all user-supplied routines are described that are required in the call to `PDAFomi_assimilate_3dvar`. For some of the generic routines, we link to the page on [ModifyModelforEnsembleIntegration modifying the model code for the ensemble integration]. |
109 | | |
110 | | To indicate user-supplied routines we use the prefix `U_`. In the template directory `templates/` as well as in the tutorial implementations in `tutorial/` these routines exist without the prefix, but with the extension `_pdaf.F90`. 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. |
111 | | |
112 | | In the subroutine interfaces some variables appear with the suffix `_p`. 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. |
113 | | |
114 | | |
115 | | === `U_collect_state` (collect_state_pdaf.F90) === |
| 109 | Here, all user-supplied routines are described that are required in the call to the assimilation routines for for parameterized 3D-Var. For some of the generic routines, we link to the page on [wiki:OnlineModifyModelforEnsembleIntegration_PDAF3 modifying the model code for the ensemble integration]. |
| 110 | |
| 111 | The names of the user-suppled routines routines ending on `_pdaf` relate to operations on the model state, while those ensing on `_pdafomi` handle observations using the structured appraoch guided by [wiki:PDAF_OMI_Overview PDAF-OMI]. The user-routines relating to PDAF-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. |
| 112 | |
| 113 | In the subroutine interfaces some variables appear with the suffix `_p`. 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. |
| 114 | |
| 115 | |
| 116 | === `collect_state_pdaf` (collect_state_pdaf.F90) === |
126 | | See the page on [InsertAnalysisStep#U_distribute_statedistribute_state_pdaf.F90 inserting the analysis step] for the description of this routine. |
127 | | |
128 | | |
129 | | === `U_init_dim_obs_pdafomi` (callback_obs_pdafomi.F90) === |
130 | | |
131 | | 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. |
132 | | |
133 | | See the [wiki:OMI_Callback_obs_pdafomi documentation on callback_obs_pdafomi.F90] for more information. |
134 | | |
135 | | |
136 | | |
137 | | === `U_obs_op_pdafomi` (callback_obs_pdafomi.F90) === |
138 | | |
139 | | 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. |
140 | | |
141 | | See the [wiki:OMI_Callback_obs_pdafomi documentation on callback_obs_pdafomi.F90] for more information. |
142 | | |
143 | | |
144 | | |
145 | | |
146 | | === `U_cvt` (cvt_pdaf.F90) === |
| 126 | See 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. |
| 127 | |
| 128 | |
| 129 | |
| 130 | === `init_dim_obs_pdafomi` (callback_obs_pdafomi.F90) === |
| 131 | |
| 132 | This is a call-back routine initializing the observation information. The routine just calls a routine from the observation module for each observation type. |
| 133 | |
| 134 | See the [wiki:OMI_Callback_obs_pdafomi documentation on callback_obs_pdafomi.F90] for more information. |
| 135 | |
| 136 | |
| 137 | |
| 138 | === `obs_op_pdafomi` (callback_obs_pdafomi.F90) === |
| 139 | |
| 140 | This 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. |
| 141 | |
| 142 | See the [wiki:OMI_Callback_obs_pdafomi documentation on callback_obs_pdafomi.F90] for more information. |
| 143 | |
| 144 | |
| 145 | |
| 146 | = |
| 147 | === `cvt_pdaf` (cvt_pdaf.F90) === |
179 | | It has to apply the adjoint control vector transformation to a state vector and return the control vector. Usually this transformation is the multiplication with transposed of the square-root of the background error covariance matrix '''B'''. |
180 | | |
181 | | If the state vector is decomposed in case of parallelization one needs to take care that the application of the trasformation is complete. This usually requries a comminucation with MPI_Allreduce to obtain a global sun. |
182 | | |
183 | | |
184 | | |
185 | | === `U_obs_op_lin_pdafomi` (callback_obs_pdafomi.F90) === |
| 180 | It has to apply the adjoint control vector transformation to a state vector and return the control vector. Usually this transformation is the multiplication with transposed of the square-root of the background error covariance matrix '''B''' in its parameterized form. |
| 181 | |
| 182 | If the state vector is decomposed in case of parallelization one needs to take care that the application of the trasformation is complete. This usually requries a comminucation with MPI_Allreduce to obtain a global sum. |
| 183 | |
| 184 | |
| 185 | |
| 186 | === `obs_op_lin_pdafomi` (callback_obs_pdafomi.F90) === |
221 | | 1. [#U_prepoststepprepoststep_ens_pdaf.F90 U_prepoststep] (Call to act on the forecast ensemble, called with negative value of the time step) |
222 | | 1. [#U_init_dim_obs_pdafomicallback_obs_pdafomi.F90 U_init_dim_obs_pdafomi] |
223 | | 1. [#U_obs_op_pdafomicallback_obs_pdafomi.F90 U_obs_op_pdafomi] (multiple calls, one for each ensemble member) |
| 223 | 1. [#prepoststep_pdafprepoststep_ens_pdaf.F90 prepoststep_pdaf] (Call to act on the forecast ensemble, called with negative value of the time step) |
| 224 | 1. [#init_dim_obs_pdafomicallback_obs_pdafomi.F90 init_dim_obs_pdafomi] |
| 225 | 1. [#obs_op_pdafomicallback_obs_pdafomi.F90 obs_op_pdafomi] (multiple calls, one for each ensemble member) |
226 | | 1. [#U_cvtcvt_pdaf.F90 U_cvt] |
227 | | 1. [#U_obs_op_linpdafomicallback_obs_pdafomi.F90 U_obs_op_lin_pdafomi] |
228 | | 1. [#U_obs_op_adjpdafomicallback_obs_pdafomi.F90 U_obs_op_adj_pdafomi] |
229 | | 1. [#U_cvt_adjcvt_adj_pdaf.F90 U_cvt_adj] |
| 228 | 1. [#cvt_pdafcvt_pdaf.F90 cvt_pdaf] |
| 229 | 1. [#obs_op_lin_pdafomicallback_obs_pdafomi.F90 obs_op_lin_pdafomi] |
| 230 | 1. [#obs_op_adj_pdafomicallback_obs_pdafomi.F90 obs_op_adj_pdafomi] |
| 231 | 1. [#cvt_adj_pdafcvt_adj_pdaf.F90 cvt_adj_pdaf] |
| 232 | |
232 | | 1. [#U_cvtcvt_pdaf.F90 U_cvt] (Call to the control vector transform to compute the final state vector increment |
233 | | 1. [#U_prepoststepprepoststep_ens_pdaf.F90 U_prepoststep] (Call to act on the analysis ensemble, called with (positive) value of the time step) |
234 | | |
235 | | In case of the routine `PDAFomi_assimilate_3dvar`, the following routines are executed after the analysis step: |
236 | | 1. [#U_distribute_statedistribute_state_pdaf.F90 U_distribute_state] |
237 | | 1. [#U_next_observationnext_observation_pdaf.F90 U_next_observation] |
| 235 | 1. [#cvt_pdafcvt_pdaf.F90 cvt_pdaf] (Call to the control vector transform to compute the final state vector increment |
| 236 | 1. [#prepoststep_pdafprepoststep_ens_pdaf.F90 prepoststep_pdaf] (Call to act on the analysis ensemble, called with (positive) value of the time step) |
| 237 | |
| 238 | In case of the routine `PDAF3_assimilate_3dvar`, the following routines are executed after the analysis step: |
| 239 | 1. [#distribute_state_pdafdistribute_state_pdaf.F90 distribute_state_pdaf] |
| 240 | 1. [#next_observation_pdafnext_observation_pdaf.F90 next_observation_pdaf] |