Building an executable and running LaGriT

The executable is built by linking a driver routine with the code and utility libraries. The driver routine must contain a call to initLaGriT and a call to control_command_lg and must contain a subroutine called user_sub.  The input arguments to initLaGriT are:

mode - set to ‘noisy’ for output to be echoed to the screen - set to ‘silent’ for no echo

log_file - name of log file (if ‘ ‘ or ‘-def-‘ use default name which is logx3dgen)  This file will contain a list of commands.

batch_file - name of batch file (if ‘ ‘ or ‘-def-‘ use default name which is outx3dgen). This file will contain a list of commands and the error, warning and informational messages generated by the command. User_sub is used to implement user commands (see Section IV.C)

A sample driver routine is listed below:

program adrivgen

PURPOSE -LaGriT driver

 implicit none
 integer ierror_return
 
 call initLaGriT('noisy',' ',' ')
 
 call control_command_lg(ierror_return)
 
 stop
 end
 
 subroutine user_sub(imsgin,xmsgin,cmsgin,msgtyp,nwds,
 
 ierr1)

PURPOSE

Process user supplied commands

INPUT ARGUMENTS

imsgin - integer array of tokens returned by parser

xmsgin - real array of tokens returned by parser

cmsgin - character array of tokens returned by parser

msgtyp - int array of token types returned by parser

nwds - number of tokens returned by parser

OUTPUT ARGUMENTS

ierr1 - 0 for successful completion - -1 otherwise

 character*32 cmsgin(nwds)
 integer imsgin(nwds),msgtyp(nwds)
  integer nwds,ierr1,lenc
 real*8 xmsgin(nwds)
 set default error return to fail
 ierr1=-1
 Insert code here to handle user coded subroutines
 For example
 if(cmsgin(1).eq.'my_cmnd') then
 call my_rtn(imsgin,xmsgin
 * cmsgin,msgtyp,nwds,ierr1)
 else
 ierr1=-1
 endif
 
 return
 end

Sample build scripts for the supported platforms are:

**Sun OS and Sun Solaris

forte version 7 compiler:**

f90 -O2 -lf77compat -o LaGriTgen adrivgen.f libLaGriT.a libutil.a

if the user wishes to link in user subroutines that contain CRAY type pointer statements, these routines must be compiled using the f77 compiler and then the .o files linked in with f90:

f77 -c -O2 user_routines.f
f90 -O2 -lf77compat -o LaGriTgen adrivgen.f user_routines.o
libLaGriT.a libutil.a

older sun compilers:

f90 -O2 -o LaGriTgen adrivgen.f libLaGriT.a libutil.a

IBM RISC

xlf -g -o LaGriTgen -qintlog -qcharlen=500 -brename:.fdate,.fdate_
adrivgen.f
libLaGriT.a libutil.a

SGI

f90 -O2 -n32 -r10000 -o LaGriTgen adrivgen.f libLaGriT.a libutil.a

Compile for 64 bit I8 SGI:

f90 -O2 -64 -i8 -o LaGriTgen adrivgen.f  libLaGriT.a libutil.

HP:

f90 +U77 -R8 -lm -o LaGriTgen adrivgen.f libLaGriT.a libutil.a

DEC COMPAQ compiler

fort -i8 -O -fast -pipeline -transform_loops -o LaGriTgen 
adrivgen.f  libLaGriT.a libutil.a

LINUX

ABSOFT compiler:

f90 -YTEXT_NAMES=LCS  -o LaGriTgen adrivgen.f fdate.f libLaGriT.a
libutila. -lm -lu77

where fdate.f is

subroutine fdate(string)
character*(*) string
call fdate_(string)
return
end

To execute, use standard unix file redirection for standard input and output. LaGriT will produce two additional files, outx3dgen and logx3dgen. The names of these files can be changed by supplying the names as arguments in the call to initLaGriT.  These files contain detailed output information and the list of commands respectively. LaGriT may also be run interactively in which case the user will be prompted to enter commands from the workstation.