Changes between Version 10 and Version 11 of CompilingPdaf


Ignore:
Timestamp:
Jun 1, 2025, 10:41:25 AM (3 days ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CompilingPdaf

    v10 v11  
    33The library file of PDAF can be compiled on its own or in connection with an example implementation from `tutorial/` or `models/`.  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 == Specify the machine-spefic compile settings ==
     5== Specify the machine-specific compile settings ==
    66
    7 To 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.
     7To 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.h` is a quite generic choice that should work on a wide range of computers.
    88
    9 The 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
    10 `setenv PDAF_ARCH <NAME>`
    11 while for bash one uses
    12 `export PDAF_ARCH=<NAME>`.
     9The 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 bash shell one uses
     10{{{
     11export PDAF_ARCH=<NAME>
     12}}}
     13where <NAME> is the name of the file in `make.arch/` with out '.h'.
    1314
    1415
     
    1617== Compiling PDAF ==
    1718
    18 To compile PDAF, do the following:
     19To compile PDAF, do the following in PDAF's main directory (denoted here PDAFROOT):
    1920
    2021{{{
     
    2223}}}
    2324
    24 The compilation with generate the PDAF library files '''PDAFROOT/lib/libpdaf-d.a''' and '''PDAFROOT/lib/libpdaf-var.a'''. In addition several Fortran module files `*.mod` are generated in the directory `PDAFROOT/include/`. These will be used when compiling the application program coupled to PDAF. The file '''PDAFROOT/lib/libpdaf-var.a''' provides the 3D-Var methods in addition to ensemble methods, while '''PDAFROOT/lib/libpdaf-d.a''' is the standard file without 3D-Var methods.
     25The compilation with generate the PDAF library files `PDAFROOT/lib/libpdaf-d.a`and `PDAFROOT/lib/libpdaf-var.a`. In addition several Fortran module files `*.mod` are generated in the directory `PDAFROOT/include/`. These will be used when compiling the application program coupled to PDAF. The file `PDAFROOT/lib/libpdaf-d.a` is the standard library containing the ensemble-based fitler methods, while the file `PDAFROOT/lib/libpdaf-var.a` provides, in addition, the 3D-Var methods and solvers.
    2526
    2627
     
    2829== Linking the PDAF library ==
    2930
    30 To point to the PDAF include directory to ensure that the modules `pdaf_interface_module.mod` and `PDAFomi.mod` are found, one should specificy
     31To point to the PDAF include directory to ensure that the module `pdaf.mod` is found, one should specificy
    3132{{{
    3233   -I${PDAFROOT}/include
    3334}}}
    34 Here `${PDAFROOT}` is the directory of the PDAF package. It can either be directly specified by replacing ${PDAFROOT} or one speficies PDAFROOT as a variable.
     35Here `${PDAFROOT}` is the directory of the PDAF package. It can either be directly specified by replacing ${PDAFROOT} or one specifies PDAFROOT as a variable.
    3536
    36 For linking the PDAF library for the ensemble schemes use
     37For linking the PDAF library for the ensemble-based filter methods use
    3738{{{
    3839   -L${PDAFROOT}/lib -lpdaf-d
     
    4849== Notes ==
    4950
    50  * '''Note on parallelization:'''[[BR]] 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.
     51 * '''Note on parallelization:'''[[BR]] PDAF is generally intended for parallel computing using MPI. As such, it is required to compile PDAF with an MPI library. Such library, like the widely used OpenMPI, is today extremely easy to install (it is virtually always available as a package in any Linux distribution and standard on cluster computers).
    5152
    5253 * '''Note on precision of floating point variables:'''[[BR]] 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.
    53   * 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.
    54   * PDAF also supports single precision. To enable it in PDAF, one has to use the preprocessor definition `-DSNGLPREC`. Then one has to compile without the double-precision settings.
     54  * 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`. The provided include files in `make.arch/` include these specifications.
     55  * PDAF also supports single precision. To enable single prevision in PDAF, one has to use the preprocessor definition `-DSNGLPREC`. Then one has to compile without the double-precision settings.