Changes between Version 1 and Version 2 of PDAFomi_observation_diagnostics


Ignore:
Timestamp:
Mar 26, 2025, 5:28:59 PM (6 days ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PDAFomi_observation_diagnostics

    v1 v2  
    3636[[PageOutline(2-3,Contents of this page)]]
    3737
     38|| PDAF-OMI observation statistics were introduced with PDAF V3.0 ||
     39
    3840The PDAF-OMI observation diagnostics module provides functionality to obtain statistics about the differences between observations and the observed model state. In addition, there are routines that provide the user access to the observations and observed quantities like the observed ensemble mean state.
    3941
     
    4850The routines for observation diagnostics can be organized in four groups
    4951 * Activation of observation diagnostics
    50    * [PDAFomi_observation_diagnostics#PDAFomi_set_obs_diag PDAFomi_set_obs_diag]
     52   * [wiki:PDAFomi_observation_diagnostics#PDAFomi_set_obs_diag PDAFomi_set_obs_diag]
    5153 * Statistics
    52    * PDAFomi_diag_rmsd
    53    * PDAFomi_diag_stats
     54   * [wiki:PDAFomi_observation_diagnostics#PDAFomi_diag_rmsd PDAFomi_diag_rmsd] - root mean square difference
     55   * [wiki:PDAFomi_observation_diagnostics#PDAFomi_diag_stats PDAFomi_diag_stats] - set of 6 statistics
    5456 * Access to observation dimensions
    55    * PDAFomi_diag_nobs
    56    * PDAFomi_diag_dimobs
     57   * [wiki:PDAFomi_observation_diagnostics#PDAFomi_diag_nobstypes PDAFomi_diag_nobstypes] - number of observation types
     58   * [wiki:PDAFomi_observation_diagnostics#PDAFomi_diag_dimobs PDAFomi_diag_dimobs] - vector of observation dimensions
    5759 * Acces to observation arrays
    58    * PDAFomi_diag_get_obs
    59    * PDAFomi_diag_get_HXmean
    60    * PDAFomi_diag_get_HX
    61    * PDAFomi_diag_get_ivar
     60   * [wiki:PDAFomi_observation_diagnostics#PDAFomi_diag_get_obs PDAFomi_diag_get_obs] -  access to observation vector
     61   * [wiki:PDAFomi_observation_diagnostics#PDAFomi_diag_get_HXmean PDAFomi_diag_get_HXmean] - access to observed ensemble mean
     62   * [wiki:PDAFomi_observation_diagnostics#PDAFomi_diag_get_HX PDAFomi_diag_get_HX] - access to observed ensemble
     63   * [wiki:PDAFomi_observation_diagnostics#PDAFomi_diag_get_ivar PDAFomi_diag_get_ivar]- access to inverse obs. error variances
     64
    6265
    6366== Activation of observation diagnostics ==
     
    7881
    7982
    80 
    81 
     83== Statistics ==
     84
     85=== PDAFomi_diag_rmsd ===
     86
     87The 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.
     88
     89The interface is:
     90{{{
     91  SUBROUTINE PDAFomi_diag_obs_rmsd(nobs, rmsd_pointer, verbose)
     92
     93    INTEGER, INTENT(inout) :: nobs                   ! Number of observation types
     94    REAL, POINTER, INTENT(inout) :: rmsd_pointer(:)  ! Pointer to vector of RMSD values
     95    INTEGER, INTENT(in) :: verbose                   ! Verbosity flag, >0 for output
     96}}}
     97
     98**Note:**
     99 * 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.
     100 * 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`.
     101 * If the observation diagnostics have not be activated by using `PDAFomi_set_obs_diag` the pointer array will not be set and `nobs=0` is returned. One can check this value before assessing the pointer array.
     102 * A more extensive set of statistics can be obtained using the routine `PDAFomi_diag_stats`.
     103
     104
     105=== PDAFomi_diag_stats ===
     106
     107The 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.
     108
     109The interface is:
     110{{{
     111  SUBROUTINE PDAFomi_diag_stats(nobs, obsstats_ptr, verbose)
     112
     113    INTEGER, INTENT(inout) :: nobs                     ! Number of observation types
     114    REAL, POINTER, INTENT(inout) :: obsstats_ptr(:,:)  ! Array of observation statistics
     115          ! Included statistics are:
     116          !  (1,:) correlations between observation and observed ensemble mean
     117          !  (2,:) centered RMS difference between observation and observed ensemble mean
     118          !  (3,:) mean bias (observation minus observed ensemble mean)
     119          !  (4,:) mean absolute difference between observation and observed ensemble mean
     120          !  (5,:) variance of observations
     121          !  (6,:) variance of observed ensemble mean
     122    INTEGER, INTENT(in) :: verbose                     ! Verbosity flag, >0 to write output
     123}}}
     124
     125**Note:**
     126 * 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.
     127 * 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)`.
     128 * If the observation diagnostics have not be activated 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
     129 * The routine returns the centered RMSD as displayed in Taylor diagrams. The non-centered RMSD can be computed using `PDAFomi_diag_obs_rmsd`.
     130
     131
     132== Access to observation dimensions ==
     133
     134=== PDAFomi_diag_nobstypes ===
     135
     136The routine returns the number of observation types that are active in an assimilation run.
     137
     138The interface is:
     139{{{
     140  SUBROUTINE PDAFomi_diag_nobstypes(nobstypes)
     141
     142    INTEGER, INTENT(inout) :: nobstypes   ! Number of observation types
     143}}}
     144
     145**Note:**
     146 * `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.
     147
     148
     149=== PDAFomi_diag_dimobs ===
     150
     151The routine returns a pointer to a vector of the number of observations (observation dimension) for each active observation type.
     152
     153The interface is:
     154{{{
     155  SUBROUTINE PDAFomi_diag_dimobs(dim_obs_ptr)
     156
     157    INTEGER, POINTER, INTENT(inout) :: dim_obs_ptr(:)   ! Pointer to observation dimensions
     158}}}
     159
     160**Note:**
     161 * 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.
     162 * If the observation diagnostics have not be activated by using [wiki:PDAFomi_set_obs_diag]. the pointer array will have length 1 and the observation dimension is returned as 0.
     163
     164
     165
     166== Acces to observation arrays ==
     167
     168The routine that provide access to observation arrays all work for a single observation type, which has to be 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.
     169
     170=== PDAFomi_diag_get_obs ===
     171
     172The 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.
     173
     174The interface is:
     175{{{
     176  SUBROUTINE PDAFomi_diag_get_obs(id_obs, dim_obs_p_diag, ncoord, obs_p_ptr, ocoord_p_ptr)
     177
     178    INTEGER, INTENT(in) :: id_obs                    ! Index of observation type to return
     179    INTEGER, INTENT(out) :: dim_obs_p_diag           ! Observation dimension
     180    INTEGER, INTENT(out) :: ncoord                   ! Number of observation dimensions
     181    REAL, POINTER, INTENT(out) :: obs_p_ptr(:)       ! Pointer to observation vector
     182    REAL, POINTER, INTENT(out) :: ocoord_p_ptr(:,:)  ! Pointer to coordinate array
     183                                                     ! (index order as in observation modules)
     184}}}
     185
     186**Notes:**
     187 * 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 processor.
     188 * 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`.
     189 * 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)`.
     190 * If the observation diagnostics have not been activated 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
     191 * The array `ocoord_p_ptr(:,:)` is organized as in the observation modules:
     192   * First index: index of different coordinate directions for observation specified by the second index
     193   * Second index: index of the observation
     194 * 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.
     195
     196
     197
     198=== PDAFomi_diag_get_HXmean ===
     199
     200The routine returns a pointer to a vector of the observed ensemble mean state for the specified observation type (`id_obs`).
     201
     202The interface is:
     203{{{
     204  SUBROUTINE PDAFomi_diag_get_HXmean(id_obs, dim_obs_diag, HXmean_p_ptr)
     205
     206    INTEGER, INTENT(in) :: id_obs                    ! Index of observation type to return
     207    INTEGER, INTENT(out) :: dim_obs_p_diag           ! Observation dimension
     208    REAL, POINTER, INTENT(out) :: HXmean_p_ptr(:)    ! Pointer to observed ensemble mean
     209}}}
     210
     211**Notes:**
     212 * In case of a parallelized model, the vector `HXmean_p_prt` contains the observed ensemble mean for the process-sub-domain
     213 * 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`.
     214 * If the observation diagnostics have not be activated 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.
     215
     216
     217
     218=== PDAFomi_diag_get_HX ===
     219
     220The routine returns a pointer to the array of the observed ensemble for the specified observation type (`id_obs`).
     221
     222The interface is:
     223{{{
     224  SUBROUTINE PDAFomi_diag_get_HX(id_obs, dim_obs_p_diag, HX_p_ptr)
     225
     226    INTEGER, INTENT(in)  :: id_obs                   ! Index of observation type to return
     227    INTEGER, INTENT(out) :: dim_obs_p_diag           ! Observation dimension
     228    REAL, POINTER, INTENT(out) :: HX_p_ptr(:,:)      ! Pointer to observed ensemble mean
     229}}}
     230
     231**Notes:**
     232 * In case of a parallelized model, the array `HX_p_prt` contains the observed ensemble for the process-sub-domain
     233 * 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)`
     234 * If the observation diagnostics have not be activated 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.
     235
     236
     237
     238=== PDAFomi_diag_get_ivar ===
     239
     240The routine returns a pointer to a vector of the inverse observation error variances for the specified observation type (`id_obs`).
     241
     242The interface is:
     243{{{
     244  SUBROUTINE PDAFomi_diag_get_ivar(id_obs, dim_obs_p_diag, ivar_p_ptr)
     245
     246    INTEGER, INTENT(in)  :: id_obs                   ! Index of observation type to return
     247    INTEGER, INTENT(out) :: dim_obs_p_diag           ! Observation dimension
     248    REAL, POINTER, INTENT(out) :: ivar_p_ptr(:)      ! Pointer to inverse observation error variances
     249}}}
     250
     251**Notes:**
     252 * In case of a parallelized model, the vector `ivar_p_prt` contains the observed ensemble mean for the process-sub-domain
     253 * 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`.
     254 * If the observation diagnostics have not be activated 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.
     255 * 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.
     256
     257
     258