
*************************** The 'README' for LATTE  ****************************

For more details on all of the following, please consult the manual we have put together in LATTE/Manual/LATTE_theGuide.pdf.

LATTE should (hopefully) be as straightforward to compile as these kinds of codes get. Simply cd to LATTE/src and modify makefile.h such that your favorite FORTRAN90 compiler and compatible implementations of the LAPACK and BLAS math libraries are specified. We have tested the (cpu-only) code with gfortran, ifort, and pgf90 with various math libraries. In our experience it is safe to 'max-out' the compiler optimization  level, plus you must inclide the appropriate OpenMP flag to use the threaded code (remember to set OMP_NUM_THREADS if you do). For example, the following makefile.h specifies we'll use gfortran with OpenMP enabled with ACML4.4.0 as our LAPACK/BLAS:

#
# Compilation and link flags for LATTE 
#

PRECISION = SINGLE
GPUOPT = OFF
CPP =  cpp -P -C -D$(PRECISION)PREC -DGPU$(GPUOPT) < $*.fortran90 > $*.f90
FC = gfortran
FCL = $(FC) -fopenmp
FFLAGS =  -O3 -fopenmp 
LINKFLAG =
GPU_LINKFLAG = -L../MATRIX -lgfortran -lstdc++
LIB = -L/home/cawkwell/acml4.4.0/gfortran64_mp/lib -lacml_mp
GPU_LIB = -L../MATRIX -lmatrix_cuda -L/usr/local/cuda/lib64 -lcublas -lcudart

More details on this makefile.h

PRECISION is a pre-processor option that selects whether you'll run in single or double precision. It can equal SINGLE or DOUBLE, only

GPUOPT is a pre-processor option that selects whether you'll run hybrid GPU/CPU code or on a CPU only. If you're running on the GPU too, you'll need to compile Ed Sanville's CUDA code in MATRIX using nvcc. GPUOPT can equal ON or OFF, only.

FC = your fortran90 compiler
FCL = linker flags
FFLAGS = optimizer flags for your fortran compiler
GPU_LINKFLAG = these are essential for linking our F90 code to the nvcc/c++ code in MATRIX
LIB = location of your favorite LAPACK/BLAS implementation
GPU_LIB = points to the Sanville's cuda library in MATRIX and NVIDIA's cuda libraries

The safest option is to compile with PRECISION = DOUBLE or SINGLE and GPUOPT = OFF.

Once you're happy with makefile.h, in LATTE/src run 'make clean' to remove any old files, and then 'make' to generate the executable 'LATTE' in LATTE/. 

To run LATTE, we recommend the following:

1) Make a new directory, ~/runLATTEcalcs, for example, and cd to it.

2) LATTE needs a small number of files and directories in specified locations in order to read inputs and write outputs. In ~/runLATTEcalcs you will need:

   i) the directories animate and Restarts to store the dump and restart files from an MD run

   ii) the directory TBparam containing the files control.in (tell's LATTE what to do) and bondints.dat, electrons.dat, and ppots.dat (parameters for the SCC-TB model you're using to simulate your system)

   iii) the file MDcontroler (specifies various things relating to your MD simulation)

   iv) a symbolic link to the executable in LATTE/

3) To actually run the code from your new directory ~/runLATTEcalcs (or whatever you decide upon), simply type at the command line ./LATTE with an optional redirect to save the output to screen.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Copyright 2010.  Los Alamos National Security, LLC. This material was    !
! produced under U.S. Government contract DE-AC52-06NA25396 for Los Alamos !
! National Laboratory (LANL), which is operated by Los Alamos National     !
! Security, LLC for the U.S. Department of Energy. The U.S. Government has !
! rights to use, reproduce, and distribute this software.  NEITHER THE     !
! GOVERNMENT NOR LOS ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY,     !
! EXPRESS OR IMPLIED, OR ASSUMES ANY LIABILITY FOR THE USE OF THIS         !
! SOFTWARE.  If software is modified to produce derivative works, such     !
! modified software should be clearly marked, so as not to confuse it      !
! with the version available from LANL.                                    !
!                                                                          !
! Additionally, this program is free software; you can redistribute it     !
! and/or modify it under the terms of the GNU General Public License as    !
! published by the Free Software Foundation; version 2.0 of the License.   !
! Accordingly, this program is distributed in the hope that it will be     !
! useful, but WITHOUT ANY WARRANTY; without even the implied warranty of   !
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General !
! Public License for more details.                                         !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


