Changes between Initial Version and Version 1 of OMI_observation_diagnostics_PDAF3


Ignore:
Timestamp:
May 27, 2025, 4:00:03 PM (5 days ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OMI_observation_diagnostics_PDAF3

    v1 v1  
     1= PDAF-OMI Observation Diagnostics =
     2
     3{{{
     4#!html
     5<div class="wiki-toc">
     6<h4>PDAF-OMI Guide</h4>
     7<ol><li><a href="PDAF_OMI_Overview_PDAF3">Overview</a></li>
     8<li><a href="OMI_Callback_obs_pdafomi_PDAF3">callback_obs_pdafomi.F90</a></li>
     9<li><a href="OMI_observation_modules_PDAF3">Observation Modules</a></li>
     10<li><a href="OMI_observation_operators_PDAF3">Observation operators</a></li>
     11<li><a href="OMI_error_checking_PDAF3">Checking error status</a></li>
     12<li><a href="OMI_debugging_PDAF3">Debugging functionality</a></li>
     13<li>Observation diagnostics</li>
     14<li><a href="OMI_additional_functionality_PDAF3">Additional OMI Functionality</a></li>
     15<li><a href="Porting_to_OMI_PDAF3">Porting an existing implemention to OMI</a></li>
     16<br>
     17<li>Related pages in Implementation Guide<li>
     18<ol>
     19<li><a href="ImplementationofAnalysisStep_PDAF3">Implementing the analysis step</a></li>
     20<li><a href="nondiagonal_observation_error_covariance_matrices_PDAF3">Using nondiagonal R-matrices</a></<li>
     21</ol>
     22</ol>
     23</div>
     24}}}
     25
     26[[PageOutline(2-3,Contents of this page)]]
     27
     28|| PDAF-OMI observation diagnostics were introduced with PDAF V3.0 ||
     29
     30The PDAF-OMI observation diagnostics module provides functionality to obtain statistics about the differences between observations and the observed model state.
     31Additionally, there are routines that provide the user with access to observations and observed quantities, such as the observed ensemble mean state.
     32
     33Here, we describe the functionalities of the observation diagnostics routines.
     34
     35A common place to call the `PDAFomi_diag` diagnostics routines is in `prepoststep_pdaf`, which is the usual place to also analyze the ensemble.
     36
     37By default, PDAF initializes the observations after `prepoststep_pdaf` was executed after the forecast. To be able to compare the observations and the forecast ensemble, one has to switch the place at which observations are initialized. This is done with
     38{{{
     39  CALL PDAF_set_iparam(9, 0)
     40}}}
     41which can be called in `init_pdaf` subsequently to the initialization of PDAF with `PDAF_init`.
     42
     43The routines for observation diagnostics can be organized in four groups
     44 * Deactivating or re-activating observation diagnostics
     45   * [wiki:PDAFomi_observation_diagnostics#PDAFomi_set_obs_diag PDAFomi_set_obs_diag]
     46 * Statistics
     47   * [wiki:PDAFomi_observation_diagnostics#PDAFomi_diag_rmsd PDAFomi_diag_rmsd] - root mean square difference
     48   * [wiki:PDAFomi_observation_diagnostics#PDAFomi_diag_stats PDAFomi_diag_stats] - set of 6 statistics
     49 * Access to observation dimensions
     50   * [wiki:PDAFomi_observation_diagnostics#PDAFomi_diag_nobstypes PDAFomi_diag_nobstypes] - number of observation types
     51   * [wiki:PDAFomi_observation_diagnostics#PDAFomi_diag_dimobs PDAFomi_diag_dimobs] - vector of observation dimensions
     52 * Acces to observation arrays
     53   * [wiki:PDAFomi_observation_diagnostics#PDAFomi_diag_get_obs PDAFomi_diag_get_obs] -  access to observation vector
     54   * [wiki:PDAFomi_observation_diagnostics#PDAFomi_diag_get_HXmean PDAFomi_diag_get_HXmean] - access to observed ensemble mean
     55   * [wiki:PDAFomi_observation_diagnostics#PDAFomi_diag_get_HX PDAFomi_diag_get_HX] - access to observed ensemble
     56   * [wiki:PDAFomi_observation_diagnostics#PDAFomi_diag_get_ivar PDAFomi_diag_get_ivar]- access to inverse observation error variances
     57
     58
     59== Deactivating or re-activating observation diagnostics ==
     60
     61=== PDAFomi_set_obs_diag ===
     62
     63By default, the observation diagnostics are active. However, as this functionality increases the required memory, it might be desirable to deactivate this functionality. This routine is used deactivate the observation diagnostics. It is also possible to re-activate the observation diagnostics at a later time.
     64
     65The routine can be called by all processes, but it is sufficient to call it for those processes that handle observations, which are usually the filter processes. A common place is to call the routine in `init_pdaf` subsequently to the initialization of PDAF in `PDAF_init`.
     66
     67The interface is:
     68{{{
     69  SUBROUTINE PDAFomi_set_obs_diag(diag)
     70
     71    INTEGER, INTENT(in) :: diag   ! Value for observation diagnostics mode
     72                                  ! =0 deactivates observation diagnostics
     73                                  ! >0 activates observation diagnostics
     74}}}
     75
     76
     77== Statistics ==
     78
     79=== PDAFomi_diag_rmsd ===
     80
     81The routine returns a pointer to a vector of the root-mean square difference (RMSD) between the observations and the observed ensemble mean for each observation type.
     82
     83The interface is:
     84{{{
     85  SUBROUTINE PDAFomi_diag_obs_rmsd(nobs, rmsd_pointer, verbose)
     86
     87    INTEGER, INTENT(inout) :: nobs                   ! Number of observation types
     88    REAL, POINTER, INTENT(inout) :: rmsd_pointer(:)  ! Pointer to vector of RMSD values
     89    INTEGER, INTENT(in) :: verbose                   ! Verbosity flag, >0 for output
     90}}}
     91
     92**Note:**
     93 * The computed RMSD is for the global model domain. Thus, in case of a parallelized model, all process sub-domains are taken into account and calling `PDAFomi_diag_obs_rmsd` will return the same value for all processes.
     94 * In Fortran user code, the pointer should be declared in the form[[BR]] `REAL, POINTER :: rmsd_ptr(:)`[[BR]] It does not need to be allocated. The target vector has the length `nobs`.
     95 * If the observation diagnostics have been deactivated by using `PDAFomi_set_obs_diag`, the pointer array will not be set and `nobs=0` is returned. One can check the value of `nobs` before assessing the pointer array.
     96 * A more extensive set of statistics can be obtained using the routine `PDAFomi_diag_stats`.
     97
     98
     99=== PDAFomi_diag_stats ===
     100
     101The routine returns a pointer to an array of a selection of 6 statistics comparing the observations and the observed ensemble mean for each observation type. The statistics can, for example, be used to plot a Taylor diagram.
     102
     103The interface is:
     104{{{
     105  SUBROUTINE PDAFomi_diag_stats(nobs, obsstats_ptr, verbose)
     106
     107    INTEGER, INTENT(inout) :: nobs                     ! Number of observation types
     108    REAL, POINTER, INTENT(inout) :: obsstats_ptr(:,:)  ! Array of observation statistics
     109          ! Included statistics are:
     110          !  (1,:) correlations between observation and observed ensemble mean
     111          !  (2,:) centered RMS difference between observation and observed ensemble mean
     112          !  (3,:) mean bias (observation minus observed ensemble mean)
     113          !  (4,:) mean absolute difference between observation and observed ensemble mean
     114          !  (5,:) variance of observations
     115          !  (6,:) variance of observed ensemble mean
     116    INTEGER, INTENT(in) :: verbose                     ! Verbosity flag, >0 to write output
     117}}}
     118
     119**Note:**
     120 * The computed statistics are for the global model domain. Thus, in case of a parallelized model, all process sub-domains are taken into account and calling `PDAFomi_diag_stats` will return the same value for all processes.
     121 * In Fortran user code, the pointer should be declared in the form[[BR]] `REAL, POINTER :: obsstats_ptr(:)`.[[BR]] It does not need to be allocated. The target array has the size `(6, nobs)`.
     122 * If the observation diagnostics have been deactivated by using `PDAFomi_set_obs_diag`, the pointer array will not be set and `nobs=0` is. One can check this value before assessing the pointer array
     123 * The routine returns the centered RMSD as displayed in Taylor diagrams. The non-centered RMSD can be computed using `PDAFomi_diag_obs_rmsd`.
     124
     125
     126== Access to observation dimensions ==
     127
     128=== PDAFomi_diag_nobstypes ===
     129
     130The routine returns the number of observation types that are active in an assimilation run.
     131
     132The interface is:
     133{{{
     134  SUBROUTINE PDAFomi_diag_nobstypes(nobstypes)
     135
     136    INTEGER, INTENT(inout) :: nobstypes   ! Number of observation types
     137}}}
     138
     139**Note:**
     140 * `nobstypes` is commonly used as the upper limit of a loop running over all observation types. In this way, `nobstypes` can be used with the `PDAFomi_diag` routines that return different observation-related arrays for a single observation type.
     141
     142
     143=== PDAFomi_diag_dimobs ===
     144
     145The routine returns a pointer to a vector of the number of observations (observation dimension) for each active observation type.
     146
     147The interface is:
     148{{{
     149  SUBROUTINE PDAFomi_diag_dimobs(dim_obs_ptr)
     150
     151    INTEGER, POINTER, INTENT(inout) :: dim_obs_ptr(:)   ! Pointer to observation dimensions
     152}}}
     153
     154**Note:**
     155 * In Fortran user code, the pointer should be declared in the form[[BR]] `INTEGER, POINTER :: dim_obs_ptr(:)`[[BR]] It does not need to be allocated.
     156 * If the observation diagnostics have been deactivated by using [wiki:PDAFomi_set_obs_diag], the pointer array will have length 1 and the observation dimension is returned as 0.
     157
     158
     159
     160== Access to observation arrays ==
     161
     162The routines that provide access to observation arrays all work for a single observation type, which is specified as the first argument. To process all observation types, one can implement a loop `DO iobs = 1, nobstypes` where `nobstype` can be obtained with `PDAFomi_diag_nobstypes`, which was described before.
     163
     164=== PDAFomi_diag_get_obs ===
     165
     166The routine returns a pointer to a vector of observations of the specified observation type (`id_obs`) and a pointer to the corresponding array of observation coordinates.
     167
     168The interface is:
     169{{{
     170  SUBROUTINE PDAFomi_diag_get_obs(id_obs, dim_obs_p_diag, ncoord, obs_p_ptr, ocoord_p_ptr)
     171
     172    INTEGER, INTENT(in) :: id_obs                    ! Index of observation type to return
     173    INTEGER, INTENT(out) :: dim_obs_p_diag           ! Observation dimension
     174    INTEGER, INTENT(out) :: ncoord                   ! Number of observation dimensions
     175    REAL, POINTER, INTENT(out) :: obs_p_ptr(:)       ! Pointer to observation vector
     176    REAL, POINTER, INTENT(out) :: ocoord_p_ptr(:,:)  ! Pointer to coordinate array
     177                                                     ! (index order as in observation modules)
     178}}}
     179
     180**Notes:**
     181 * In case of a parallelized model, the vector `obs_p_prt` and the array `ocoord_p_prt` contain the values for the process sub-domain of the calling process.
     182 * In Fortran user code, the pointer to the observation vector should be declared in the form[[BR]] `REAL, POINTER :: obs_p_ptr(:)`.[[BR]] It does not need to be allocated. The target vector has the length `dim_obs_p_diag`.
     183 * In Fortran user code, the pointer to the observation coordinates should be declared in the form[[BR]] `REAL, POINTER :: ocoord_p_ptr(:,:)`.[[BR]] It does not need to be allocated. The target array has the size `(ncoord, dim_obs_p_diag)`.
     184 * If the observation diagnostics have been deactivated by using `PDAFomi_set_obs_diag`, the pointers will not be set and `dim_obs_p_diag=0` and `ncoord=0` will be returned. These values can be checked before assessing the pointer arrays
     185 * The array `ocoord_p_ptr(:,:)` is organized as in the observation modules:
     186   * First index: index of different coordinate directions for observation specified by the second index
     187   * Second index: index of the observation
     188 * One can access the values in `obs_p_prt` and `ocoord_p_prt` like usual arrays. There is no particularity with respect to being pointers.
     189
     190
     191
     192=== PDAFomi_diag_get_HXmean ===
     193
     194The routine returns a pointer to a vector of the observed ensemble mean state for the specified observation type (`id_obs`).
     195
     196The interface is:
     197{{{
     198  SUBROUTINE PDAFomi_diag_get_HXmean(id_obs, dim_obs_diag, HXmean_p_ptr)
     199
     200    INTEGER, INTENT(in) :: id_obs                    ! Index of observation type to return
     201    INTEGER, INTENT(out) :: dim_obs_p_diag           ! Observation dimension
     202    REAL, POINTER, INTENT(out) :: HXmean_p_ptr(:)    ! Pointer to observed ensemble mean
     203}}}
     204
     205**Notes:**
     206 * In case of a parallelized model, the vector `HXmean_p_prt` contains the observed ensemble mean for the process sub-domain
     207 * In Fortran user code, the pointer to the observed ensemble mean should be declared in the form: [[BR]] `REAL, POINTER :: HXmean_p_ptr(:)`[[BR]] It does not need to be allocated. The target vector has the length `dim_obs_p_diag`.
     208 * If the observation diagnostics have been deactivated by using `PDAFomi_set_obs_diag`, the pointer will not be set and `dim_obs_diag=0` will be returned. This value can be checked before assessing the pointer array.
     209
     210
     211
     212=== PDAFomi_diag_get_HX ===
     213
     214The routine returns a pointer to the array of the observed ensemble for the specified observation type (`id_obs`).
     215
     216The interface is:
     217{{{
     218  SUBROUTINE PDAFomi_diag_get_HX(id_obs, dim_obs_p_diag, HX_p_ptr)
     219
     220    INTEGER, INTENT(in)  :: id_obs                   ! Index of observation type to return
     221    INTEGER, INTENT(out) :: dim_obs_p_diag           ! Observation dimension
     222    REAL, POINTER, INTENT(out) :: HX_p_ptr(:,:)      ! Pointer to observed ensemble mean
     223}}}
     224
     225**Notes:**
     226 * In case of a parallelized model, the array `HX_p_prt` contains the observed ensemble for the process sub-domain.
     227 * In Fortran user code, the pointer to the observed ensemble should be declared in the form:[[BR]] `REAL, POINTER :: HX_p_ptr(:,:)`[[BR]] It does not need to be allocated. The target array has the size `(dim_obs_p_diag, dim_ens)`
     228 * If the observation diagnostics have been deactivated by using `PDAFomi_set_obs_diag`, the pointer will not be set and `dim_obs_diag=0` will be returned. This value can be checked before assessing the pointer array.
     229
     230
     231
     232=== PDAFomi_diag_get_ivar ===
     233
     234The routine returns a pointer to a vector of the inverse observation error variances for the specified observation type (`id_obs`).
     235
     236The interface is:
     237{{{
     238  SUBROUTINE PDAFomi_diag_get_ivar(id_obs, dim_obs_p_diag, ivar_p_ptr)
     239
     240    INTEGER, INTENT(in)  :: id_obs                   ! Index of observation type to return
     241    INTEGER, INTENT(out) :: dim_obs_p_diag           ! Observation dimension
     242    REAL, POINTER, INTENT(out) :: ivar_p_ptr(:)      ! Pointer to inverse observation error variances
     243}}}
     244
     245**Notes:**
     246 * In case of a parallelized model, the vector `ivar_p_prt` contains the observed ensemble mean for the process sub-domain.
     247 * In Fortran user code, the pointer to the vector of inverse observation variances should be declared in the form[[BR]] `REAL, POINTER :: ivar_p_ptr(:)`[[BR]] It does not need to be allocated. The target vector has the length `dim_obs_p_diag`.
     248 * If the observation diagnostics have been deactivated by using `PDAFomi_set_obs_diag`, the pointer will not be set and `dim_obs_diag=0` will be returned. This value can be checked before assessing the pointer array.
     249 * If the feature `thisobs%inno_omit` is used (see the [wiki:PDAFomi_additional_functionality page Additional functionality of PDAF-OMI]), the inverse variance of the omitted observations will show the small value set by `inno_omit`. One can use this information to exclude such observations when analyzing differences between observations and observed ensemble.
     250
     251
     252