PDAFomi_set_searchtype
This page documents the function PDAFomi_set_searchtype of PDAF, which was introduced with PDAF 3.1.
The routine PDAFomi_set_searchtype allows to choose the type of the search operation for observations within the localization cut-off radius ('local observations') in domain-localized ensemble filters (i.e. LESTKF, LETKF, LNETF, LKNETF, LSEIK)
In PDAF V3.1 we optimized the search for local observations. For example, we introduced a variant which first sorts the observation according to their coordinates along a chosen coordinate direction and then performs a tree search to determine observations that possibly lie within the radius. This can significantly reduce the length of the search loop and hence speed up the search. We also introduced variants that only perform a single search loop. In PDAF V3.0 and before the search was done twice: A first loop counted the observations within the radius. Then local observation arrays were allocated with the correct size and a second search loop was done which filled the arrays. For a single loop, we allocate the local observation array at their maximum size (i.e. the number of full observations) and then fill only the first elements up to the number of observation within the radius. While this approach is faster, it requires more memory.
The interface is:
SUBROUTINE PDAFomi_set_searchtype(search_type, sortdir)
with the following arguments:
INTEGER, INTENT(in) :: search_type !< Type of search operation
! 0: Search routine of PDAF 3.0
! 1: Optimized search code
! 2: Optimized search code with only one search loop
! 11: Search type using sorted observations
! 12: Search type using sorted observations with only one search loop
! 21: Search type using sorted observations with a computed upper loop limit
! 22: Search type using sorted observations with a computed upper loop limit
! and only one search loop
!< (2, 12 and 22 need more memory as arrays are allocated with full observation dimension)
INTEGER, INTENT(in) :: sortdir !< Sorted doordinate direction
Notes:
- The default of PDAF V3.1 is
search_type=2(this is a conservative choice to ensure that the results don't change) - Generally,
search_type=22 should yield the best search performance, but needs more memory. - In experiments, we saw that the search performance of the different types depends on the distribution of the observations. Generally type 0 is slowest, but the performance of the other cases is case-specific.
- search types 11-22 can give slightly different assimilation results compared 0-2, because the sorting of observations change the order of computations.
- Usually,
sortdirshould be the highest index of coordinate direction along which a large variability of coordinates exist, e.g. the latitude in geographic coordinates sortdircannot be a direction with periodicity (e.g. longitude in global Earth models is periodic and not a proper choice)
