%! tut_errors.tex $ this file belongs to the Molcas repository $*/
\section{Most frequent error messages found in MOLCAS}

\index{Error messages}
\index{Error}

Due to the large number of systems where the \molcas\ package is
executed and the large number of options included in each of
the programs it is not possible to compile here all the possible
sources of errors and error messages occurring in the calculations.
The \molcas\ codes contain specific error message data basis where
the source of the error and the possible solution is suggested.
Unfortunately it is almost impossible to cover all the possibilities.
Here the user will find a compendium of the more usual errors
showing up in \molcas\ and the corresponding error messages.

Many of the error messages the user is going to obtain are specific
for the operative system or architecture being used. 
The most serious ones are in most of cases 
related with compiler problems, operative system incompatibilities,
etc. Therefore the meaning of this errors must be checked in the proper 
manuals or with the computer experts, and if they are characteristic
only of \molcas, with \molcas\ authors. The most common, however,
are simple mistakes related to lack of execution or reading
permission of the shell scripts, \molcas\ executable modules, etc.

In the following the most usual errors found in \molcas\ are listed.

\begin{itemize}


\index{Error!molcas undefined}
\item The shell is unable to find the command \command{molcas}.
      The message in this case is, for instance:

\begin{sourcelisting}
  molcas:  not found
\end{sourcelisting}

 The solution is to add into the PATH the location of molcas driver script.

\index{Error!MOLCAS undefined}

\item If the \molcas\ environment is not properly installed the
 first message showing up in the default error file is:

\begin{sourcelisting}
***
*** Error: Could not find molcas driver shell
*** Currently MOLCAS=
\end{sourcelisting}
 
 Typing a command \command{molcas}, you can check which molcas
 installation will be used. Check the value of the variable \variable{MOLCAS},
 and define it in order to point to the proper location of molcas installation.
 
\index{Error!ENV undefined}

\item Environment is not defined

 An attempt to run an executable without molcas driver scripts gives
 an error:
\begin{sourcelisting}
  Usage: molcas module_name input
\end{sourcelisting}



 \item A call for a program can find problems like the three following ones:

\begin{sourcelisting}
Program NNNN is not defined 
\end{sourcelisting}
 
An error means that requested module is missing or the package is not installed.

\index{Error!Input file not found}

\item When the input file required for a \molcas\ program is not
      available, the program will not start at all and no output
      will be printed, except in the default error file where the
      following error message will appear:

\begin{sourcelisting}
 Input file specified for run subcommand not found : seward
\end{sourcelisting}

\index{Error!RUNFILE}

\item All the codes communicate via file \file{RUNFILE}, if for a some reason
the file is missing or corrupted, you will get an error 

\begin{sourcelisting}
***    Record not found in runfile
\end{sourcelisting}

 The simple solution - restart seward to generate proper \file{RUNFILE}

\index{Error!ONEINT}
\index{Error!ORDINT}

\item All the codes need integral files generated by \program{SEWARD} in
      files \file{ONEINT} and \file{ORDINT}.
      Even the direct codes need the one-electron integrals stored
      in \file{ONEINT}. The most common problem is then that a program
      fails to read one of this files because \program{SEWARD} has not
      been executed or because the files are read in the wrong address.
      Some of the error messages found in those cases are listed here.
    
      In the \program{SCF} module, the first message will appear when
      the one-electron integral file is missing and the second when 
      the two-electron integral file is missing:

\begin{sourcelisting}
Two-electron integral file was not found!
 Try keyword DIRECT in SEWARD.
\end{sourcelisting}

\index{Error!Insufficient memory}
\item  \molcas\ use dynamical allocation of memory for temporary arrays.
 An error message 'Insufficient memory' means that requested value
 is too small - you have to specify MOLCAS\_MEM variable and restart your
 calculation. 
 
\index{Error!memory allocation}
 \item if user ask to allocate (via MOLCAS\_MEM) an amount of memory, 
 which is large than possible on this computer, the following error message
 will be printed.
 
\begin{sourcelisting}
MA error: MA_init: could not allocate 2097152152 bytes
The initialization of the memory manager failed ( iRc=  1 ).
\end{sourcelisting}
 

\index{Error!input error}

\item An improper input (e.g. the code expects to read more numbers, than 
user specified in input file) will terminate the code with errorcode 112.

\index{Error!Disk address problems}
\index{Error!I/O problems}

\item Input/Output (I/O) problems are common, normally due to insufficient
  disk space to store the two-electron integral files or some of the
  intermediate files used by the programs. The error message would depend
  on the operative system used. An example for the \program{SCF} is
  shown below:

\begin{sourcelisting}
 *******************************************************************************
 *******************************************************************************
 ***                                                                         ***
 ***                                                                         ***
 ***    Location: AixRd                                                      ***
 ***    File: ORDINT                                                         ***
 ***                                                                         ***
 ***                                                                         ***
 ***    Premature abort while reading buffer from disk:                      ***
 ***    Condition: rc != LenBuf                                              ***
 ***    Actual   :                0!=          262144                        ***
 ***                                                                         ***
 ***                                                                         ***
 *******************************************************************************
 *******************************************************************************
\end{sourcelisting}

 The error indicates that the file is corrupted, or there is a bug in the 
 code. 


\item Sometimes you might experience the following problem with GEO/HYPER
      run:

\begin{sourcelisting}
  Quaternion tested
  mat. size =     4x    1
   -0.500000000
    0.500000000
   -0.500000000
    0.000000000
 ###############################################################################
 ###############################################################################
 ###                                                                         ###
 ###                                                                         ###
 ###    Location: CheckQuater                                                ###
 ###                                                                         ###
 ###                                                                         ###
 ###                                                                         ###
 ###    Quaternion does not represent a rotation                             ###
 ###                                                                         ###
 ###                                                                         ###
 ###############################################################################
 ###############################################################################

\end{sourcelisting}

 The error indicates that you need to rearrange the Cartesian coordinates
 (atoms) of one or another fragment.

\end{itemize}
 
\clearpage
%\section{\molcasversion\ Flowchart}
%\label{TUT:sec:flow_all}
%\begin{figure}[hbt]
%\leavevmode
%\flowchart{all}
%\caption{Program module dependencies flowchart for MOLCAS. Shadow boxes represent optative modules to be installed independently.}
%\label{fig:flow_all}
%\end{figure}

%\clearpage
%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: 
