Frequently Asked Questions

Table of contents

  1. Problems about compilation
    1. General advice
    2. Changing compiler
    3. File not found
    4. Undefined reference
  2. Files
    1. File cannot be opened
    2. Input/output Error
  3. Displaying results
    1. Cannot import AtmoPy
    2. getd fails
  4. Miscellaneous questions
    1. Checking results
    2. Contact

Compiling

General advice if compilation does not work.

A good advice is to try and redo compilation from the beginning. Indeed problem can be due to a program which should have been recompiled but has not.

Type ../../utils/scons.py -c or make cleanall to delete all compiled files. This allows starting from a clean start.

How to change the compiler?

I do not use the "default" compiler, what do I have to do to make compilation work with my compiler.

If you use SCons, have a look on the section of chapter 2 that is dedicated to compiling. It should be rather simple to set up.

If you still use make, you will have to edit the various makefile files. You have to modify CC the C++ compiler, F77 the Fortran77 compiler, LINK the linker. You may also have to modify LIB, the path to the various libraries (blitz++, lapack and libg2c) and LIBRAN if you plan to use data assimilation.

Note for GCC 4.0 or 4.1 users: In GCC 4.0 the Fortran compiler has changed and is called GFORTRAN. Make sure thus to change the compiler in makefile otherwise you may use an older version of G77 and it is not compatible with the newer versions of G++.

Furthermore, if you use GFORTRAN, you will need to replace -lg2c in the LINKFLAGS of makefile with -lgfortran.

File not found

When I try to compile some programs, I have an error message stating that one/several files or directory are not found. For example,

In file included from ../../include/SeldonData/Format.hxx:33,
                 from ../../include/SeldonData/Format.cxx:20,
                 from ../../include/SeldonData/SeldonData.hxx:148,
                 from ../../include/AtmoData/AtmoData.hxx:26,
                 from meteo.cpp:34:
../../include/SeldonData/decode_grib.cpp:28:18: error: pds4.h: No such file or directory
../../include/SeldonData/decode_grib.cpp:29:17: error: gds.h: No such file or directory
../../include/SeldonData/decode_grib.cpp:30:17: error: bms.h: No such file or directory
../../include/SeldonData/decode_grib.cpp:31:17: error: bds.h: No such file or directory
../../include/SeldonData/decode_grib.cpp:32:20: error: cnames.h: No such file or directory
[...]

This is likely due to an external library which has not been installed. Currently, the libraries needed are:

Library Program(s) using it.
Newran polair3d-oi.cpp
polair3d-enkf.cpp
polair3d-rrsqrt.cpp
polair3d-4dvar.cpp
polair3d-gradient.cpp
polair3d-gradient-4dvar.cpp
polair3d-adjoint.cpp
polair3d-mc.cpp
WGRIB meteo.cpp
attenuation.cpp
Isorropia polair3d-siream.cpp
Eqsam polair3d-siream.cpp

Note that you have to rename the elements of Isorropia: ISOCOM.FOR as isocom.f, ISOFWD.FOR as isofwd.f, ISOREV.FOR as isorev.f and ISRPIA.INC as isrpia.inc and to put them in directory include/isorropia/. For installation of other libraries, refer to the user's guide.

Undefined reference

Linking of my object file with Fortran routines fail. I have an error message stating that the routine is undefined. For example,

gaussian-deposition_aer.cpp:(.text+0x232c6): undefined reference to `compute_gravitational_settling_'
collect2: ld returned 1 exit status

In case a Fortran routine name contains a underscore, some compilers append one underscore at the end of its identifier (in the compiled object) and others append two underscores. A test has been developed to determine how many underscore are appended but this test can fail if you use untested or mixed compilers (typically a C++ compiler and a Fortran compiler from different packages.)

If the test fails while compiling with make (it should not happen with SCons!), you have to add to the compiler flag (CCFLAGS) the option -DPOLYPHEMUS_SINGLE_UNDERSCORE (if there is an undefined reference to a routine with two underscores at the end) or -DPOLYPHEMUS_DOUBLE_UNDERSCORE (if there is an undefined reference to a routine with one underscore at the end).

Note that if you change compilers, you are advised to use ../../utils/scons.py -c (or make cleanall if you still use make) so you can compile all the code with the same compiler. For the same reason, you might have to recompile newran library.

Files

Unable to open a file

When I start my simulation, I have an error

ERROR!
An input/output operation failed in FormatBinary<T>::Append(Array<TA, N>& A, string FileName).
   Unable to open file "results/NO.bin".

If the file which cannot be opened is an output of the program you are using, this can be due to the fact that the directory in which it should be saved does not exist. Remember that Polyphemus does not create the directories in which results are saved and that you have to create them beforehand.

Input/Output Error

When I launch the simulation I have an error:

ERROR!
An input/output operation failed in FormatBinary<T>::Read(ifstream& FileStream, Array<TA, N>& A).
   Unable to read 42900 byte(s). The input stream is empty.
Check your data file (for example polair3d-data.cfg) and make sure that for each section ([initial_conditions], [boundary_conditions], ...) the minimum date Date_min is consistent with the way the data files were generated.

Displaying results

Cannot import AtmoPy

When I try to import AtmoPy in ipython, I have an error:

ImportError: No module named atmopy

Check your PYTHONPATH. You can access it by shell command "echo $PYTHONPATH". If the path to AtmoPy is not in your PYTHONPATH, add it:

getd fails

When I try to use atmopy.display.getd, I have an error:

ValueError: total size of new array must be unchanged

This is likely due to an error in the value of Nz or Nt in your display configuration file (for example, disp.cfg). Remember that you should not put the values of Nz and Nt for which the simulation was performed but for which concentrations were saved.

Miscellaneous questions

Checking results

Here is a list of things you can do if your results are unsatisfactory:

Contact

If you have not found the solution to your problem on this page nor in the user's guide, contact polyphemus-help@lists.gforge.inria.fr