wiki:AuxiliaryRoutines

Version 3 (modified by lnerger, 11 years ago) (diff)

--

Auxiliary Routines

PDAF provide a number of auxiliary routines. They serve to access PDAF-internal data, which is not available through the regular interface of PDAF.

PDAF-D_get_smootherens.F90

This routine is called to set a Fortran pointer to the array in PDAF that stores the ensembles for smoothing. Also, the routine sets the available lag of the smoothing.

CALL PDAF_get_smootherens(sens_pointer, maxlag, status)

The variables in the interface are the following:

  • sens_pointer: The pointer to the smoother ensemble. The dimension is sens_pointer(:,:,:). Thus in the program calling PDAF_get_smmotherens one has to declare REAL, POINTER :: sens_pointer(:,:,:). On output it points to the smoother ensemble.
  • maxlag: Number of lags stored in the smoother ensemble. While in the call to PDAF_init the maximum lag for the smoother is set, not all possible lags are using at the beginning of the assimilations. maxlag shows how many times were already smoothed.
  • status: Status flag. 0 for successful exit.

Important:

  • Because sens_pointer is a pointer, the call to PDAF_get_smootherens needs an explicit Fortran interface. This is provided by the Fortran module PDAF_interfaces_module. In the header part of the routine that calls PDAF_get_smootherens one has to include use PDAF_interfaces_module!

Notes:

  • PDAF_get_smootherens is typically called in the prepoststep routine after the analysis step. At this time not only the filtered analysis step can be analized, but also all smoothed ensembles.
  • The first two indices of sens_pointer are identical to those in the ensemble array ens_p. Thus, the array contains state vectors in its columns. The second index is the ensemble index. The third index is the lag. Thus, if the value of the third index is fixed one can use the array sens_pointer analogous to the ensemble array ens_p.
  • For an example using PDAF_get_smootherens see the example implementation testsuite/src/dummymodel_1D/. The routine is called in compute_rms_smoother.F90.

PDAF-D_set_smootherens.F90

This routine is called to set a Fortran pointer to the array in PDAF that stores the ensembles for smoothing. In addition, it sets the available lag of the smoothing. This routine is called in the offline mode of PDAF. While in the online mode, the smoother ensemble array is filled automatically by PDAF, one has to fill it manually in the offline mode. PDAF_set_smootherens gives access to the smoother array to fill it.

CALL PDAF_set_smootherens(sens_pointer, maxlag, status)

The arguments are:

  • sens_pointer: The pointer to the smoother ensemble. The dimension is sens_pointer(:,:,:). Thus in the program calling PDAF_get_smmotherens one has to declare REAL, POINTER :: sens_pointer(:,:,:). On output it points to the smoother ensemble.
  • maxlag: Set the number of lags stored in the smoother ensemble. While in the call to PDAF_init the maximum lag for the smoother is set, not all possible lags are using at the beginning of the assimilations. maxlag says how many times were already smoothed. Both values are usually identical for the offline mode.
  • status: Status flag. 0 for successful exit.

Important:

  • Because sens_pointer is a pointer, the call to PDAF_set_smootherens needs an explicit Fortran interface. This is provided by the Fortran module PDAF_interfaces_module. In the header part of the routine that calls PDAF_set_smootherens one has to include use PDAF_interfaces_module!

Notes:

  • PDAF_set_smootherens is typically called in the initialization phase of PDAF. It was to be called after the basic initialization of PDAF in PDAF_init. A possible location is to call PDAF_set_smootherens is the ensemble initialization routine U_init_ens.
  • The first two indices of sens_pointer are identical to those in the ensemble array ens_p. Thus, the array contains state vectors in its columns. The second index is the ensemble index. The third index is the lag. Thus, if the value of the third index is fixed one can use the array sens_pointer analogous to the ensemble array ens_p.