| 77 | |
| 78 | == `U_init_dim_obs` (init_dim_obs.F90) == |
| 79 | |
| 80 | This routine is used by all global filter algorithms (SEEK, SEIK, EnKF, ETKF). |
| 81 | |
| 82 | The interface for this routine is: |
| 83 | {{{ |
| 84 | SUBROUTINE init_dim_obs(step, dim_obs_p) |
| 85 | |
| 86 | INTEGER, INTENT(in) :: step ! Current time step |
| 87 | INTEGER, INTENT(out) :: dim_obs_p ! Dimension of observation vector |
| 88 | }}} |
| 89 | |
| 90 | The routine is called at the beginning of each analysis step. It has to initialize the size `dim_obs_p` of the observation vector according to the current time step. Without parallelization `dim_obs_p` will be the size for the full model domain. When a domain-decomposed model is used, `dim_obs_p` will be the size of the observation vector for the sub-domain of the calling process. |
| 91 | |
| 92 | Some hints: |
| 93 | * It can be useful if not only the size of the observation vector is determined at this point. One can also already gather information about the location of the observations, which will be used later, e.g. to implement the observation operator. An array for the locations can be defined in a module like `mod_assimilation`. |
| 94 | |
| 95 | == `U_obs_op` (obs_op.F90) == |
| 96 | |
| 97 | This routine is used by all global filter algorithms (SEEK, SEIK, EnKF, ETKF). |
| 98 | |
| 99 | The interface for this routine is: |
| 100 | {{{ |
| 101 | SUBROUTINE obs_op(step, dim_p, dim_obs_p, state_p, m_state_p) |
| 102 | |
| 103 | INTEGER, INTENT(in) :: step ! Currrent time step |
| 104 | INTEGER, INTENT(in) :: dim_p ! PE-local dimension of state |
| 105 | INTEGER, INTENT(in) :: dim_obs_p ! Dimension of observed state |
| 106 | REAL, INTENT(in) :: state_p(dim_p) ! PE-local model state |
| 107 | REAL, INTENT(out) :: m_state_p(dim_obs_p) ! PE-local observed state |
| 108 | }}} |
| 109 | |
| 110 | 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`. |
| 111 | |
| 112 | For a model using domain decomposition, the operation is on the PE-local sub-domain of the model and has to provide the observed sub-state for the PE-local domain. |
| 113 | |
| 114 | Hint: |
| 115 | * If the observation operator involves a global operation, e.g. some global integration, while using domain-decompostion one has to gather the information from the other model domains using MPI communication. |
| 116 | |
| 117 | == `U_init_obs` (init_obs.F90) == |
| 118 | |
| 119 | This routine is used by all global filter algorithms (SEEK, SEIK, EnKF, ETKF). |
| 120 | |
| 121 | The interface for this routine is: |
| 122 | {{{ |
| 123 | SUBROUTINE init_obs(step, dim_obs_p, observation_p) |
| 124 | |
| 125 | INTEGER, INTENT(in) :: step ! Current time step |
| 126 | INTEGER, INTENT(in) :: dim_obs_p ! PE-local dimension of obs. vector |
| 127 | REAL, INTENT(out) :: observation_p(dim_obs_p) ! PE-local observation vector |
| 128 | }}} |
| 129 | |
| 130 | The routine is called during the analysis step. |
| 131 | It has to provide the vector of observations in `observation_p` for the current time step. |
| 132 | |
| 133 | For a model using domain decomposition, the vector of observations that exist on the model sub-domain for the calling process has to be initialized. |
| 134 | |
| 135 | |
| 136 | == `U_prodRinvA` (prodrinva.F90) == |
| 137 | |
| 138 | This routine is used by all filters whose algorithm uses the inverse of the observation error covariance matrix (SEEK, SEIK, and ETKF). |
| 139 | |
| 140 | The interface for this routine is: |
| 141 | {{{ |
| 142 | SUBROUTINE prodRinvA(step, dim_obs_p, rank, obs_p, A_p, C_p) |
| 143 | |
| 144 | INTEGER, INTENT(in) :: step ! Current time step |
| 145 | INTEGER, INTENT(in) :: dim_obs_p ! PE-local dimension of obs. vector |
| 146 | INTEGER, INTENT(in) :: rank ! Rank of initial covariance matrix |
| 147 | REAL, INTENT(in) :: obs_p(dim_obs_p) ! PE-local vector of observations |
| 148 | REAL, INTENT(in) :: A_p(dim_obs_p,rank) ! Input matrix from analysis routine |
| 149 | REAL, INTENT(out) :: C_p(dim_obs_p,rank) ! Output matrix |
| 150 | }}} |
| 151 | |
| 152 | The routine is called during the analysis step. In the algorithms the product of the inverse of the observation error covariance matrix with some matrix has to be computed. For the SEIK filter this matrix holds the observed part of the ensemble perturbations. The matrix is provided as `A_p`. The product has to be given as `C_p`. |
| 153 | |
| 154 | For a model with domain decomposition, `A_p` contains the part of the matrix that resides on the model sub-domain of the calling process. The product has to be computed for this sub-domain, too. |
| 155 | |
| 156 | Hints: |
| 157 | * the routine does not require that the product is implemented as a real matrix-matrix product. Rather, the product can be implemented in its most efficient form. For example, if the observation error covariance matrix is diagonal, only the multiplication of the diagonal with matrix `A_p` has to be implemented. |
| 158 | * The observation vector `obs_p` is provided through the interface for cases where the observation error variance is relative to the actual value of the observations. |
| 159 | |
| 160 | |
| 161 | |
| 162 | == `U_init_obsvar` (init_obsvar.F90) == |
| 163 | |
| 164 | This 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 impementation). |
| 165 | |
| 166 | The interface for this routine is: |
| 167 | {{{ |
| 168 | SUBROUTINE init_obsvar(step, dim_obs_p, obs_p, meanvar) |
| 169 | |
| 170 | INTEGER, INTENT(in) :: step ! Current time step |
| 171 | INTEGER, INTENT(in) :: dim_obs_p ! PE-local dimension of observation vector |
| 172 | REAL, INTENT(in) :: obs_p(dim_obs_p) ! PE-local observation vector |
| 173 | REAL, INTENT(out) :: meanvar ! Mean observation error variance |
| 174 | }}} |
| 175 | |
| 176 | The routine is called in the global filters during the analysis or |
| 177 | by the routine that computes an adaptive forgetting factor (PDAF_set_forget). |
| 178 | The routine has to initialize the mean observation error variance. |
| 179 | For the global filters this should be the global mean. |
| 180 | |
| 181 | Hints: |
| 182 | * For a model with domain-decomposition one might use the mean variance for the model sub-domain of the calling process. Alternatively one can compute a mean variance for the full model domain using MPI communication (e.g. the function `MPI_allreduce`). |
| 183 | * The observation vector `obs_p` is provided to the rotine for the case that the observation error variance is relative to the value of the observations. |
| 184 | |