= PDAF_localfilter = This page documents the function `PDAF_localfilter` of PDAF, which was introduced with PDAF 3.0. The function is an alternative to the subroutine [wiki:PDAF_get_localfilter]. In `PDAF_localfilter` the return value of the function is directly used, while for `PDAF_get_localfilter` the return value is an argument of the routine. The function returns the information whether the chosen filter is a domain-localized filter (LESTKF, LETKF, LSEIK, LNETF). It also indicates the ENSRF since these filters use the same observation handling of the domain-localized filters. The function can be called in `assimilate_pdaf` to control whether to call either PDAF3_assimilate_global or PDAF3_assimilate_local (or PDAF3_put_state_global or PDAF3_put_state_local). The function can only be used if PDAF was initialized before by a call to `PDAF_init`. The interface is: {{{ INTEGER FUNCTION PDAF_localfilter() }}} without arguments. The return value is * 1 for local filters (including ENSRF/EAKF),[[br]] * 0 for global filters (including LEnKF, which performs covariance localization) The return value can be directly used, e.g. as {{{ IF (PDAF_localfilter() == 1) THEN CALL PDAF3_assimilate_local(...) ELSE CALL PDAF3_assimilate_global(...) ENDIF }}} **Notes:** * The difference between the return values 0 and 1 is mainly the way how PDAF-OMI handles observations. * For the ENSRF/EAKF, PDAF_localfilter() also returns the value 1. This is because the observation handling for the ENSRF/EAKF uses the same approach as for domain-localized filters