/Tonto

Unofficial mirror of Tonto from https://sourceforge.net/projects/tonto-chem/, see

Primary LanguageC

Welcome to Tonto!

===============
Compiling Tonto
===============

To compile Tonto, type :

   perl -w scripts/Makefile.pl
   make

If you want a specific compiler, type:

   perl -w scripts/Makefile.pl -fc=<insert-your-compiler-here>
   make

where you should replace <insert-your-comipler-here> with the 
command for your fortran compiler.

=====================================
Where to get a free fortran compiler?
=====================================

Use gfortran.

On Linux, install it using your package manager.

On Windows install cygwin, the unix-like environment for Windows. 
Then use cygwin to install gfortran, perl etc.

For Mac, download gfortran from:

   http://gcc.gnu.org/wiki/GFortranBinaries    
   http://quatramaran.ens.fr/~coudert/gfortran/

======================
Running the test suite
======================

To run the tests, type:

   make tests

=================================
Where to find example input files
=================================

Look in the directories in the tests/ folder.

The example inputs are called "stdin" and the example outputs are
called "stdout". 

Some of these examples need auxiliary input files, which are also
in there.

================
How to run tonto
================

Make an input file called "stdin" ... or copy one you like from the
tests/ folder; then type:

   ./<your-compiler-on-your-OS>/<build>/run_molecule.exe

Congratulations, you just ran Tonto! Confused?

   <your-compiler-on-your-OS> 
   
   ... is a directory appropriate for your platform, which is created
   automatically when you compile Tonto. It is also called the
   "platform-specific directory";
   
   <build>

   ... is one of "fast", "debug" or "custom" depending on what has
   been set in compile options for your platform (normally it is
   "fast"). <build> is also called the "build subdirectory".

You can also copy the above executable to the place where you put
programs. Why not rename it to "tonto" as well ?

If you do this, then remember to copy or link the basis_sets/
directory into where you run tonto; or else, in the "stdin" file,
set the "basis_set_directory=" .

Look at the web site for more info.

===============================
Vim, ctags, and code completion
===============================

To get the documentation use the vim editor!

. Copy the supplied .vimrc and .vim directories in tonto/ into 
  your home directory. 

. Start up vim or gvim on one of the files in foofiles/ .  
  And enjoy! 

. To unfold routines and see the doco, type "zo". 
  To close type "zc".

. Type F2 to get a sidebar which summarises the module. 
  Type F2 again to get rid of the sidebar.

. Click in the sidebar to go to the routine you want (gvim only). 

To "jump" to different routines:

. Get exuberant ctags (google it), and copy the .ctags int tonto/
  into your home directory, then type:

      ctags *

. Then, in the vim type "g Ctrl-]" when the cursor is on top of the

. If there are multiple routines with the same name, choose the one
  you really want to see.

. To jump back to where you were, Type "Ctrl-t". Wonderful!

Finally, for code completion. This is cool. 

. When editing a .foo file with vim, set up .ctags as above and type:

      :FooCompleteOn
   
. Now try adding a dot after a variable, and while still in insert
  mode, after the dot type

      Ctrl-X Ctrl-O

  You will see a pop-up menu with the available object methods. Type a
  few more characters to narrow down the choice. The method is listed
  as a type-component/attribute (a), subroutine (s), function (f),
  type-definition (t), macro (m), or global variable (g).  For more
  details type 

      :help completion 
   
  and look at the omni completion documentation.

Can somebody help me do the same for the emacs editor?

=============================
Problems, bugs, contributions
=============================

Let me know at 

   dylan.jayatilaka@uwa.edu.au

If you can fix your own bugs, let me know too, and you can easily
check the fixes back into sourceforge. 

=============================
Compiling compact executables
=============================

Still here? :=)

Executables in Tonto tend to be big. If your executable is too big,
you can remove all "dead code" from your application by typing:

   make compactify
   make

Consider also using the -DNO_GENERIC_NAMES compile option. See below.

=========================
Compiling custom versions
=========================

By default, normally, a nearly production version of Tonto is
compiled. This is called the "fast" version. 

You can also compile "debug" and "custom" versions of of Tonto using
the compile switches described in the "compiler options file". This
file is located in the platforms/ directory, and it has a name like
<your-compiler-on-your-OS>  e.g. GNU-gfortran-on-LINUX.

For example, if you change $(FOPTNS) to: 

   $(FFAST), 
   ... the executables will be placed in the fast/ subdirectory of 
   the platform-specific directory.

   $(FDEBUG), 
   ... the executables will be placed in the debug/ subdirectory of
   the platform-specific directory. Useful for getting error messages
   which I may ask you for if there is trouble.

   $(FPROF), 
   ... the executables will be placed in the custom/ subdirectory of
   the platform-specific directory. You can also change the $(FPROF)
   to include your desired fortran compiler options. Useful for
   profiling slow parts of code, and for developing.

There are also other kinds of compile options which control the type
of Fortran code which is generated. To actiavte these options you
just add them to the $(DEFS) variable in the compiler options file.

A summary of switches which control the type of Fortran generated is
given below. You can use multiple options if it is sensible to do so.

-DMPI                         Parallel Tonto, using MPI. If using this  
                              option, you must specify your specific
                              MPI libraries in the platforms fil by
                              setting the $(LIBS) variable e.g. -lmpi
                                                                       
-DFLUSH                       Flush output to stdout. The compiler must
                              have the flush() command.
                                                                       
-DNO_TONTO_SYSTEM_CALLS       No system checks, no parallel calls
                                                                       
-DNO_TONTO_SYSTEM_CHECKS      No system checks, retain parallel calls.
                              You must still define MPI
                                                                       
-DNO_GENERIC_NAMES            Prepend module name to routines. This may
                              reduce compile time by reducing the
                              namespace, but will have nonstandard
                              routine names > 31 characters long.
                                                                       
-DUSE_ERROR_MANAGEMENT        Use DIE and WARN macros i.e. the minimal
                              amount of error checking (default)
                                                                       
-DUSE_PRECONDITIONS           Use routine preconditions.This is more
                              robust error checking, but there will be
                              a perfomance hit. This option implies the
                              use of USE_ERROR_MANAGEMENT.
                                                                       
-DUSE_CALL_STACK_MANAGEMENT   Tracks the call tree.  Good for tracking
                              errors and warnings. Big performance hit.
                              If possible, try to use the compilers own
                              instruments. This option imples the use
                              of USE_PRECONDITIONS
                                                                       
-DTRACK_MEMORY_LOCATIONS      Tracks all memory allocation and
                              deallocation. Useful for eliminating
                              memory leaks.  Compiler must have loc()
                              pointer function. Consider using the
                              compilers own options e.g. the g95
                              compiler. This option implies the use of
                              USE_CALL_STACK_MANAGEMENT
                                                                       
-DUSE_TIME_PROFILING          Time profile routines. Not very accurate.
                              Consider using the compiler profiling
                              tools. This option implies the use of
                              BROKEN_PURE
                                                                       
-DBROKEN_PURE                 Set this option if the Fortran PURE
                              attribute does not work (very rare).
                              Needed for time profiling to allow IO.
                                                                       
-DBROKEN_TYPE_INITIALIZATION  Set this option if type initialisation
                              fails. Very rare these days.
                                                                       
-DLANGUAGE_FORTRAN_90         Implies the use of:
                              + BROKEN_TYPE_INITIALIZATION      
                              + BROKEN_PURE
                                                                       
-DESSL                        Use ESSL math libraries. IBM only.  
                                                                       
-DNO_CASE_OPTIONS             Removes informative error on string-based
                              case statements i.e. removes listing of
                              allowed keywords in Tonto.