Changes between Initial Version and Version 1 of OMI_additional_functionality_PDAF3


Ignore:
Timestamp:
May 27, 2025, 3:53:07 PM (6 days ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OMI_additional_functionality_PDAF3

    v1 v1  
     1= Additional Functionality of PDAF-OMI =
     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>Additional OMI Functionality</li>
     14<li><a href="Porting_to_OMI_PDAF3">Porting an existing implemention to OMI</a></li>
     15<br>
     16<li>Related pages in Implementation Guide<li>
     17<ol>
     18<li><a href="ImplementationofAnalysisStep_PDAF3">Implementing the analysis step</a></li>
     19<li><a href="nondiagonal_observation_error_covariance_matrices_PDAF3">Using nondiagonal R-matrices</a></<li>
     20</ol>
     21</ol>
     22</div>
     23}}}
     24
     25[[PageOutline(2-3,Contents of this page)]]
     26PDAF-OMI provide some additional functionality which is described here.
     27
     28The additional functionalities are:
     29- [wiki:PDAFomi_additional_functionality_PDAF3#Non-isotropiclocalization Non-isotropic localization]
     30- [wiki:PDAFomi_additional_functionality_PDAF3#Omittingobservationsthatarepotentialoutliers Omitting observations that are potential outliers]
     31- [wiki:PDAFomi_additional_functionality_PDAF3#Usingdomain-limitedobservations Using domain-limited observations]
     32- [wiki:PDAFomi_additional_functionality_PDAF3#Initializationroutines Initialization routines] (added in PDAF V2.3.1)
     33
     34== Non-isotropic localization ==
     35
     36The localization cut-off radius and the support radius of the localization function are specified in each observation module in the calls to [wiki:OMI_observation_modules_PDAF3#init_dim_obs_l_OBSTYPE init_dim_obs_l_OBSTYPE] and [wiki:OMI_observation_modules_PDAF3#init_dim_obs_l_OBSTYPE localize_covar_OBSTYPE].
     37
     38If the cut-off and support radius are defined as scalar variables, the localization is **isotropic** (same radius in all directions). This was the only option before PDAF V2.2.
     39
     40With PDAF V2.2 a **non-isotropic localization** is supported. For this one has to define the variables for the cut-off and support radii as vectors with the same length as the number of coordinates used in the distance calculation of the localization. Then each element of the vectors specifies a directional radius (e.g. in longitude and latitude in geographic coordinates; if 3-dimensional localization is used, one can in addition specify a separate radius for the vertical direction) and a separate radius can be specified for each direction.
     41
     42The non-isotropic localization is computed as an ellipse in 2 dimensions and as an ellipsoid in 3 dimensions. Thus, the distance between the model grid point and an observation (or between two model grid points in case of the LEnKF) is compared to a directional cut-off radius of the ellipse or ellipsoid that is computed from the elements of the vector specifying the cut-off radii (likewise fo rthe support radii).
     43
     44
     45
     46== Omitting observations that are potential outliers ==
     47
     48If the difference between observations and the ensemble mean state if very large, the observations can have the effect that the data assimilation increment becomes very large and this might lead to unrealistic increments. A large difference might indicate that the observation value is not reliable (thus an 'outlier'), but it can also happen if a forecast state estimate is e.g. biased or if an initial state estimate is far away from the current situation measured by the observations.
     49
     50PDAF V2.2 introduced an option to omit observations if their difference from the ensemble mean is too large. Here 'too large' is measured as a multiple of the observation error variance which is compared to the square of the difference.
     51
     52=== Activating observation omission ===
     53
     54Whether observations are omitted is controlled by the variable
     55{{{
     56   REAL :: thisobs%inno_omit    ! Omit observation if absolute innovation is larger this factor times (default=0.0)
     57                                !     observation standard deviation (only active for >0)
     58}}}
     59For the default value `thisobs%inno_omit=0.0` no observation are omitted.
     60To use this omission functionality set in [wiki:OMI_observation_modules#init_dim_obs_OBSTYPE init_dim_obs_OBSTYPE] in the observation modules `thisobs%inno_omit` to a value > 0.0. This activates the omission and specifies the omission limit. If thisobs%inno_omit=2.0, an observation would be omitted if the absolute value of the difference between the observed ensemble mean state and the observation value is larger than 2 times the observation error standard deviation.
     61
     62To omit an observation, its inverse observation error variance is set by default to the very small value
     63{{{
     64   REAL :: thisobs%inno_omit_ivar=1.0e-12  ! Value of inverse variance to omit observation
     65                                           !     (should be much larger than actual observation error variance)
     66}}}
     67Thus, the observation is prescribed to have a large error variance and hence has no effect in the assimilation. (The observation is not removed from the assimilation, but just made irrelevant). Depending on the observation, this default value might not be small enough to make an observation irrelevant. If this is the case, one can also specify a different value of `thisobs%inno_omit_ivar` in the observation module.
     68
     69|| **Note:** From PDAF V2.3.1 one can also call the routines [wiki:PDAFomi_set_inno_omit] and [wiki:PDAFomi_set_inno_omit_ivar] instead of setting the values directly in the code ||
     70
     71When `thisobs%inno_omit` is set to >0, you should see a screen output like
     72{{{
     73PDAFomi     --- Exclude obs. type ID   1  if innovation^2 >     3.00 times obs. error variance
     74}}}
     75(Note that is line is a bit misleading. It's actually 'if innovation > 3.00 times obs. error standard deviation')
     76
     77=== Statistics about omitted observations ===
     78
     79The number of omitted observation can be seen from the output of the observation statistics. For domain-localized filters, like the LESTKF the output looks like the following:
     80{{{
     81PDAFomi     --- Global statistics for locally omitted observations:
     82PDAFomi        Local domains with omitted observations:               607
     83PDAFomi        Local domains without omitted observations:             41
     84PDAFomi        Maximum number of locally omitted observations:          3
     85PDAFomi        Maximum number of locally used observations:            14
     86PDAFomi        Total avg. locally omitted observations:      1.5
     87PDAFomi        Total avg. locally used observations:         8.1
     88PDAFomi        Avg. omitted for domains with omitted observations:          1.6
     89PDAFomi        Avg. used for domains with omitted observations:             8.2
     90}}}
     91(This example uses the tutorial case `tutorial/offline_2D_serial`: We add `thisobs%inno_omit=3.0` in `obs_A_pdafomi.F90` and run as `./PDAF_offline -dim_ens 9 -filtertype 7 -cradius 10`. Thus, we omit observations if the squared difference between model and observations is large than 3 observation error variancse). In this case observations were omitted in 607 local analysis domains, while no observations were omitted in 41 domains. The maximum number of locally omitted observations if 3, while on average 1.5 observations were omitted.
     92
     93In case of the LEnKF, the output looks like:
     94{{{
     95PDAFomi         Global statistics for omitted observations:
     96PDAFomi           Global number of omitted observations:          4
     97PDAFomi           Global number of used observations:            24
     98}}}
     99
     100
     101== Using domain-limited observations ==
     102
     103=== Overview (thisobs%use_global_obs=0) ===
     104
     105In the domain-localized filters (LESTK, LETKF, LSEIK, LNETF) observations are assimilated that are located within the localization around some grid point. When a model uses parallelization with domain-decomposition some of these observations might belong to a different process-domain. In the default mode (`thisobs%use_global_obs`=1) PDAF-OMI gathers all globally available observations so that each process has access to all observations.
     106
     107It can be more efficient to limit the observations on a process-domain to those observations that are located inside the domain or within the localization radius around it. Then, in the local analyses less observations have to be checked for their distance. Setting `thisobs%use_global_obs=0` (or `CALL PDAFomi_set_use_global_obs(thisobs,0)` from PDAF V2.3.1) activates this feature. However, it needs additional preparations to make PDAF-OMI aware of the limiting coordinates of a process sub-domain.
     108
     109In order to make use of the domain-limited observations, one has to provide PDAF-OMI with the limiting coordinates of a process-subdomain. There are two routines that can to this task:
     110- `PDAFomi_set_domain_limits`
     111- `PDAFomi_get_domain_limits_unstrc`
     112One of these routines has to be called in `init_pdaf` to set the domain information. Their use is described below.
     113
     114After this call, OMI is set up to use domain-limited observations with `thisobs%use_global_obs=0`. The necessary operation will be performed by PDAF-OMI inside `PDAFomi_gather_obs` and inside the observation operators. This feature has to be activated separately for each observation type. However, mixing the settings 0 and 1 is possible.
     115
     116'''Note:''' The domain-limitation is only implemented to work in two dimensions.
     117
     118
     119=== `PDAFomi_set_domain_limits` ===
     120
     121In this routine one provide the limiting coordinates of the process domain so that PDAF-OMI can store the information.
     122
     123The interface is
     124{{{
     125  SUBROUTINE PDAFomi_set_domain_limits(lim_coords)
     126
     127    REAL, INTENT(in) :: lim_coords(2,2)     !< coordinate array (1: longitude, 2: latitude)
     128                                            !< geographic range: longitude (-pi, pi), latitude (-pi/2, pi/2)
     129                                            !< Cartesian range: (x) coordinate grows from left to right; (y) from bottom to top
     130}}}
     131here `lim_coords` are
     132{{{
     133           (2,1)
     134   (:,1)+---------+
     135        |         |           - (1,1) longitude of the western edge of the domain (or x-coordinate of the left edge)
     136        |         |           - (1,2) longitude of the eastern edge of the domain (or x-coordinate of the right edge)
     137  (1,1) |         | (1,2)     - (2,1) latitude of the northern edge of the domain (or y-coordinate of the upper edge)
     138        |         |           - (2,2) latitude of the southern edge of the domain (or y-coordinate of the lower edge)
     139        |         |
     140        +---------+(:,2)
     141           (2,2)
     142}}}
     143Thus, (:,1) specifies the north-western corner of the sub-domain and (:,2) the souther-estern corner. The first (x) coordinate grows from left to right, while the second coordinate (y) increases from bottom to the top.
     144
     145If the model grid is not decomposed in cardinal directions, but e.g. rotated, the coordinates should specife the extrema. Thus, lim_coords(1,1) would be the coordinate of the northernmost grid point of a domain.
     146
     147Note:
     148- The domain limits are coded for two dimensions, which are usually the horizontal directions. If the observations have e.g. three dimensions, the first two will be used for the domain-limitation. In case of geographic coordinates these are longituare and latitude.
     149
     150
     151=== `PDAFomi_get_domain_limits_unstrc` ===
     152
     153This routine is find the extreme coordinates for a model domain. The routine is provided with the coordinates of all grid pints of a domain and then find the limiting coordinates. It is designed for unstructured grid and we have only tested it with the ocean model FESOM. (The tricky part is when a process-domain crosses the date line).
     154
     155The interface is
     156{{{
     157  SUBROUTINE PDAFomi_get_domain_limits_unstr(verbose, npoints_p, coords_p)
     158
     159    INTEGER, INTENT(in) :: verbose          !< verbosity flag (1: write output)
     160    INTEGER, INTENT(in) :: npoints_p        !< number of process-local grid points
     161    REAL, INTENT(in) :: coords_p(:,:)       !< geographic coordinate array, dimension (2, npoints_p)
     162                                            !<   (row 1: longitude, 2: latitude)
     163                                            !<   ranges: longitude (-pi, pi), latitude (-pi/2, pi/2)
     164}}}
     165
     166This function only supports geographic coordinates given in radians.
     167
     168== Determining observation localization weights ==
     169
     170When using non-diagonal observation error covariance matrices **R**, one has to code the localization weighting in the user-supplied routines. To obtain the localization weight according to the distance between the local analysis domain and the observation, one can utilize the routine `PDAFomi_observation_localization_weights, which ensures that the OMI-internal information is correctly handled.
     171
     172=== PDAFomi_observation_localization_weights ===
     173
     174This routine was introduced with PDAF V2.3.
     175
     176This routine returns a vector of observation localization weights computed according to the localization specifications in `thisobs_l` and observation coordinates in `thisobs`. The routine can be called in `prodRinvA_l_pdafomi` or `likelihood_l_pdafomi` in order to obtain the localization weights for observations. For diagonal observation error covariance matrices, the weighting is computed by OMI internally, but for nondiagonal R-matrices, the use had to implement the application of the localization.
     177
     178The interface is the following:
     179{{{
     180  SUBROUTINE PDAFomi_observation_localization_weights(thisobs_l, thisobs, ncols, &
     181             A_l, weight, verbose)
     182
     183    TYPE(obs_l), INTENT(inout) :: thisobs_l  ! Data type with local observation
     184    TYPE(obs_f), INTENT(inout) :: thisobs    ! Data type with full observation
     185    INTEGER, INTENT(in) :: ncols             ! Rank of initial covariance matrix
     186    REAL, INTENT(in) :: A_l(:, :)            ! Input matrix, size (thisobs_l%dim_obs_l, ncols)
     187    INTEGER, INTENT(in) :: verbose           ! Verbosity flag
     188    REAL, INTENT(out) :: weight(thisobs_l%dim_obs_l) ! Localization weights
     189}}}
     190
     191
     192Notes:
     193 * Array `A_l` is usually the input argument to the routine [wiki:prodRinvA_l_pdaf prodRinvA_l_pdaf]. It is only used when the regulated localization is used.
     194 * The regulated localization computes an alternative localization function based on the ration of state error variances to observation error variances. the regulated localization method is described in the paper Nerger et al. (Quarterly Journal of the Royal Meteorological Society, 138 (2012) 802-812; see [wiki:PublicationsandPresentations publications].)
     195
     196
     197== Initialization routines ==
     198
     199With PDAF V2.3.1 we have introduced a number of routines than can be used to initialize different quantities in `thisobs`. With these routines can can avoid to set these variables in `thisobs` directly in the code. One can also avoid to allocate arrays in `thisobs` in the user code, which can be useful e.g. for programming languages like C. The routines are
     200 * [wiki:PDAFomi_set_disttype]
     201 * [wiki:PDAFomi_set_doassim]
     202 * [wiki:PDAFomi_set_domainsize]
     203 * [wiki:PDAFomi_set_icoeff_p]
     204 * [wiki:PDAFomi_set_id_obs_p]
     205 * [wiki:PDAFomi_set_inno_omit]
     206 * [wiki:PDAFomi_set_inno_omit_ivar]
     207 * [wiki:PDAFomi_set_ncoord]
     208 * [wiki:PDAFomi_set_obs_err_type]
     209 * [wiki:PDAFomi_set_use_global_obs]