Changes between Version 6 and Version 7 of CompilingPdaf
- Timestamp:
- Jan 9, 2022, 4:37:32 PM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CompilingPdaf
v6 v7 3 3 The 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. 4 4 5 == Specify the machine-spefic compile settings == 6 5 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. 6 8 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`. 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>`. 13 8 14 9 15 … … 14 20 {{{ 15 21 cd src/ 16 make PDAF_ARCH=<ARCH>22 make [PDAF_ARCH=<NAME>] 17 23 }}} 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'''.19 24 20 25 The 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. … … 29 34 {{{ 30 35 cd src/ 31 make pdaf-var PDAF_ARCH=<ARCH>36 make pdaf-var [PDAF_ARCH=<NAME>] 32 37 }}} 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'''.34 38 35 39 The compilation with generate the PDAF library file '''PDAFROOT/lib/libpdaf-var.a'''. This library also includes the ensemble filters and smoothers. … … 39 43 == Linking the PDAF library == 40 44 41 To point to the PDAF include directory to ensure that `pdaf_interface_module` and the `PDAFomi` moduleare found, one should specificy45 To point to the PDAF include directory to ensure that the modules `pdaf_interface_module.mod` and `PDAFomi.mod` are found, one should specificy 42 46 {{{ 43 47 -I${PDAFROOT}/include … … 63 67 * '''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 68 * 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.