= PDAF_set_smootherens = This page documents the routine `PDAF_set_smootherens` of PDAF. This routine is only used when smoother is to be done in the offline implementation. It is typically called in `init_pdaf` after the call to `PDAF_init`. The routine `PDAF_set_smootherens` is used when the smoother extension of a filter is used. In this case, the smoothed ensemble states at earlier times are stored in an internal array of PDAF. To be able to smooth post times, the smoother algorithm must have access to the past ensembles. In the offline mode the user has to ensure that this is the case (In contrast in the online mode, the smoother array is filled automatically during the cycles of forecast phases and analysis steps) by manually filling the smoother ensemble array from ensembles read in from files. The routine `PDAF_get_smootherens` sets a pointer to the PDAF-internal smoother array. when the routine is called one has to specify the, the number of previous smoothed times. After the call one can then write the ensemble at the previous times into the ensemble array. After this, the filter analysis step and the smoother can be computed as usual called one of the routines `PDAF_assimilate_X` or `PDAF_put_state_X` where 'X' denotes the name of the chosen filter algorithm. The interface is the following: {{{ SUBROUTINE PDAF_set_smootherens(sens_point, maxlag, status_pdaf) }}} with the following arguments: * `sens_point` : Upon exiting the routine, it points to the smoother array. On the calling side, it has to specified as 'REAL, POINTER :: sens_pointer(:,:,:)' * `maxlag` : An integer in which the user provides the number of smoothed time instances in the smoother array. * `status_pdaf`: The integer status flag. It is 0, if the routine is exited without errors. Notes: * '''Important''': The feature to use a pointer as an argument is Fortran2003 standard. In order to make this call work, an explicit Fortran interface is required. For this, one has to include the interface declaration from PDAF's interfaces module by {{{ USE PDAF_interfaces_module, ONLY: PDAF_set_smootherens }}} * When the pointer `sens_point` is set, the dimensions are `sens_point(dim_p, dim_ens, smoothed_times)`. Thus, the first two indices are for an ensemble array at the smoother time specified by the third index. * The third index in `sens_point` is directed into the past, thus for a value of 1 one accesses the most recent smoothed time. * The smoother is only performed for time instances at which the filter analysis step is performed. Thus, one has access to the last `smoothed_times` analysis times. * `maxlag` has to be consistent with the setting of the smoother lag (`dim_lag`) specified in the call to `PDAF_init`. That is, `maxlag` must not be larger than `dim_lag`, but can be smaller.