Changes between Version 6 and Version 7 of CompilingPdaf


Ignore:
Timestamp:
Jan 9, 2022, 4:37:32 PM (3 years ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CompilingPdaf

    v6 v7  
    33The 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== Specify the machine-spefic compile settings ==
     6
    57To 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.
    68
    7 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 `setenv PDAF_ARCH NAME` while for bash one uses `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 (t)csh shell one can set the variable by
     10`setenv PDAF_ARCH <NAME>`
     11while for bash one uses
     12`export PDAF_ARCH=<NAME>`.
     13
    814
    915
     
    1420{{{
    1521   cd src/
    16    make PDAF_ARCH=<ARCH>
     22   make [PDAF_ARCH=<NAME>]
    1723}}}
    18 where `<ARCH>` is the filename of the computer-specific settings from the directory `PDAFROOT/make.arch/` without `.h`. A common choice is '''<ARCH>=linux_gfortran_openmpi'''.
    1924
    2025The compilation with generate the PDAF library file '''PDAFROOT/lib/libpdaf-d.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.
     
    2934{{{
    3035   cd src/
    31    make pdaf-var PDAF_ARCH=<ARCH>
     36   make pdaf-var [PDAF_ARCH=<NAME>]
    3237}}}
    33 where `<ARCH>` is the filename of the computer-specific settings from the directory `PDAFROOT/make.arch/` without `.h`. A common choice is '''<ARCH>=linux_gfortran_openmpi'''.
    3438
    3539The compilation with generate the PDAF library file '''PDAFROOT/lib/libpdaf-var.a'''. This library also includes the ensemble filters and smoothers.
     
    3943== Linking the PDAF library ==
    4044
    41 To point to the PDAF include directory to ensure that `pdaf_interface_module` and the `PDAFomi` module are found, one should specificy
     45To point to the PDAF include directory to ensure that the modules `pdaf_interface_module.mod` and `PDAFomi.mod` are found, one should specificy
    4246{{{
    4347   -I${PDAFROOT}/include
     
    6367 * '''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.
    6468  * 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`.
     69  * 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.