Changes between Version 5 and Version 6 of CompilingPdaf


Ignore:
Timestamp:
Jan 9, 2022, 4:30:15 PM (2 years ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CompilingPdaf

    v5 v6  
    11= Compiling the PDAF library =
    22
    3 The tutorial implementations in the directory `PDAFROOT/tutorial/` (Here `PDAFROOT` is the directory of the PDAF package) and the models implemented with PDAF in `PDAFROOT/models/` are configures to also compile the PDAF library when the model or tutorial program is compiled. In these cases, one does not need to compile the PDAF library separately.
     3The library file of PDAF can be compiled on its own or in connection with an example implementation from `tutorial/`, `models/`, or `testsuite/`.  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. Here, we describe the stand-alone compilation, which one can use for example to compile some model code with added coupling for PDAF.
    44
    5 The PDAF library, thus the core routines of PDAF and PDAF-OMI, can also be compiled separately. This is the common approach when one implements PDAF with some models in the online-coupled setup (see e.g. the directory `modelbindings`).
     5To compile the PDAF library first choose a suitable include file for the make process and/or edit one. In the directory `make.arch/` several include files are provided. 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.
     6
     7The environment variable PDAF_ARCH specifies for which architecture you compile PDAF according to your choice above. 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). For a (t)csh shell one can set the variable by `setenv PDAF_ARCH NAME` while for bash one uses `export PDAF_ARCH=NAME`.
     8
    69
    710== Compiling PDAF for ensemble filters and smoothers ==
     
    5255
    5356Apart from the PDAF library, one also needs to specify the location of the BLAS and LAPACK libraries (for example by setting `-lblas -llapack` if the libraries are installed in standard directories)
     57
     58
     59== Notes ==
     60
     61 * '''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 PDAF 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.
     62
     63 * '''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.
     64  * 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.
     65  * PDAF also supports single precision. To enable it in PDAF, one has to use the preprocessor definition `-DSNGLPREC`.