wiki:SoftwarePackage

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

--

The Software package

Getting the code package

A package archive with the source code of PDAF and its test suite can be downloaded after registration from the download page.

Structure of the package

The software package contains the following directories:

  • lib/
    • This is the directory in which the library object file of PDAF is created upon compilation.
  • make.arch/
    • This directory contains machine-specific include files for the Makefile.
  • modelbindings/
    • This directory contains the PDAF bindings for real simulation models (starting with PDAF 1.13 for MITgcm)
  • models/
    • This directory contains fully implemented toy models for assimilation experiments with PDAF (added in PDAF 1.15)
  • src/
    • This directory contains the source code of the core routines of PDAF. In addition, a Makefile is included to compile the PDAF library file.
  • templates/
    • This directory contains stubs for all user-supplied routines required by the different filters. These files can be used for the own implementation (alternatively one can base on the routines of the example implementations in testsuite/.)
  • testsuite/
    • This directory contains the test suite of PDAF including example implementations. For more details see the section on the test suite
  • tutorial/
    • This directory contains example implementations of the analysis step in the online and offline modes of PDAF
  • external/
    • From PDAF V2.0, this directory contains external libraries, in particular solver methods used in 3D-Var

Compiling the PDAF library

The library file of PDAF can be compiled on its own or in connection with an example implementation from tutorial/, models/, or testsuite/. Here, we describe the stand-alone compilation. In order to build the library file, you need a Fortran-2003 compatible compiler and 'make'. In addition, the libraries 'BLAS', 'LAPACK', and 'MPI' are required.

Compiling the PDAF library is conduction in the following steps:

  1. Choose a suitable include file for the make process and/or edit one. In the directory make.arch/ several include files are provided. There are include files for compilation with and without MPI. The name of the include files as well as the header comment in the file described the intended architecture. The choice linux_gfortran_openmpi.h is a quite generic choice that should work on a wide range of computers.
  1. The environment variable PDAF_ARCH specifies for which architecture you compile PDAF according to your choice in step 1. You need to specify the file name without '.h'. You can specify PDAF_ARCH in the make command line like make PDAF_ARCH=NAME. Alternatively, you can set the environment variable $PDAF_ARCH in the shell to the name of the include file (without ending .h), e.g. by setenv PDAF_ARCH NAME in case of a (t)csh or export PDAF_ARCH=NAME in case of bash.
  1. Execute cd src and type 'make' at the prompt. This will compile the sources. The library file is generated in the directory lib/.
  • Note on parallelization: PDAF is generally intended for parallel computing using MPI. Before PDAF V2.0 it was also possible to compile PDAF without MPI by using a stub library that simulated the behavior for MPI for a single process that we provided with PDAF. With PDADF V2.) we revised the MPI implementation and removed this option. Given that it is today extremely easy to install an MPI library (it is virtually always available as a package in any Linux distribution and standard on cluster computers) we prefer not to invest in maintaining and upgrading the MPI stub library.
  • Note on precision of floating point variables: PDAF is designed to use floating point variables of double precision. However, for flexibility the variables are decared in the source code without a 'KIND' specification. Thus, for the compilation one has to specify that the compiler treats all 'real' variables with double precision accuracy. This is done, e.g. for gfortran by setting -fdefault-real-8 or for ifort by setting -r8. In the provided include files in make.arch/ these specifications are included. (Starting from version 1.8 of PDAF also single precision is supported. To enable it in PDAF, one has to use the preprocessor definition -DSNGLPREC.)

Tutorial Implementations

The directory tutorial/ contains different example implementations as well as inputs file used to run the examples (from Version 1.9 of PDAF). They are the recommended starting point to study the online and offline implementations of PDAF.

  • offline_2D_serial
    • This directory contains the example implementation of the offline mode without parallelization
  • offline_2D_parallel
    • This directory contains a parallel example implementation of the offline mode
  • online_2D_serialmodel
    • This directory contains an example implementation of the online mode with a serial model
  • online_2D_serialmodel_2fields
    • This directory contains an example implementation of the online mode with a serial model using multivariate assimilation
  • online_2D_parallelmodel
    • This directory contains an example implementation of the online model with a parallelized model

Please see the tutorial page for the tutorials describing these implementations.

Models

The following example implementations are included in the directories in models/ (from PDAF 1.15; before they were included in testsuite/):

  • lorenz63
    • This directory currently the Lorenz-63 model. In PDAF V1.14 we also added the data assimilation. Because of its small size, this model an be e.g. used with the Particle Filter. Compiling and running this model is described in detail on the page on the Lorenz-63 model.
  • lorenz96
    • This directory contains the Lorenz-96 model as well as a full data assimilation implementation of the model with PDAF. This model can be configured to have a sufficiently large state dimension to test low-rank filter algorithms like the SEIK filter. (We have using this model for example in the study: Janjić, T., Nerger, L., Albertella, A., Schröter, J., Skachko S. (2011). On domain localization in ensemble based Kalman filter algorithms. Monthly Weather Review, 139, 2046-2060 ( doi:10.1175/2011MWR3552.1).) Compiling and running this model is described in detail on the page on the Lorenz-96 model.
  • lorenz2005b
    • Added in PDAF V2.0, this directory contains the Lorenz-2005 model variant II as well as a full data assimilation implementation of the model with PDAF. It is considerd as an improved variant of the Lorenz-96 model.
  • lorenz2005c
    • Added in PDAF V2.0, this directory contains the two-scale model Lorenz-2005-III (introduced by Lorenz(2005), there called model variant III) as well as a full data assimilation implementation of the model with PDAF.

The Test Suite

The test suite of PDAF is included in the directory testsuite/. It is rather intended for our internal verification tests. It contains the following sub-directories:

  • bin/
    • This directory will contain the executable program when an example case is compiled
  • src/
    • This directory contains the example implementations. In addition the Makefile to compile the examples is included.
  • tests_dummy1D/
    • This directory contains scripts to run a series of test runs with the example implementation from testsuite/src/dummymodel_1D. In addition example outputs are included in the sub-directories. These outputs can be used to compare your own test runs with existing outputs. (The example outputs in out.linux_gfortran are from test runs on a Linux PC using the gfortran compilers both with and without parallelization. The example outputs in out.cray_xc_hlrn have been produced using a Cray XC40 Supercomputer with parallelization.)

Implementations in the test suite

The following example implementations are included in the directories in testsuite/src/:

  • dummymodel_1D
    • This is the example implementation in which PDAF is fully connected to a model. The model is trivial: At each time step simply the time step size is added to the state vector. This example can be used as the starting point for the 'flexible' online implementation variant of PDAF.
  • dummymodel_1D_si
    • This directory contains an analogous example implementation to dummymodel_1D. This variant, however, uses the simplified interface of PDAF. In this case, predefined names of the user-supplied subroutines are used such that there is no need to specify them in the call to the interface of PDAF. (The interface looks simpler in this case, but the subroutine names are fixed)
  • dummymodel_1D_snglprec
    • This directory contains an analogous example implementation to dummymodel_1D. This variant, however, uses single precision (We recommend to use double precision for numerical computation. However, if a model is implemented in single precision PDAF can be used with this model (starting from Version 1.8 of PDAF))
  • offline_1D
    • This example shows the usage of PDAF as an offline tool. In the offline configuration one computes manually the ensemble integrations and supplies this information to PDAF through files. For simplicity, this example does not use files, but generates dummy-information in the code itself.

Compiling test cases and tutorial implementations

To get started with PDAF we recommend to follow the instructions on First Steps with PDAF.