A mechanism has been provided to allow casual users of the CONGEN to write their own special purpose subroutines which can be incorporated into the system without threatening its integrity.
There are two "hooks" into the protein system which have been specially
provided for casual modifiers. The first is the USER command which
invokes the subroutine,
USERSB, and performs no other action.
USERSB is a subroutine with no arguments. However, parameters may
be passed to this subroutine via the system's
COMMON blocks store nearly all of the systems data. These
common blocks may be obtained by including them from the directory
containing the sources for the version of the program you are using.
The second hook is the user energy function
USERE is a
subroutine that is called whenever the total energy and its derivatives
USERE has ten parameters (in order):
Thus the call should be:
EU should be set to the value of the user energy upon return. If
this value is non-zero, it will be automatically printed each time the
energy is evaluated. The system supplied version of
nothing except set
EU to zero. The coordinates are supplied via
Z. Derivatives of the user energy must
be added to
DZ. All other information
USERE must be obtained through the system's common blocks
as is the case with
USERSB. Older versions of
used only the first seven variables of the call can still be linked and
run in the main section of the program, but will fail in the analysis
USERE fill only the arrays that are being requested
ANALYS (otherwise you will get access violations). In the analysis
section of the program do not assume that the common block information
will be correct for a comparison data structure, it may not be.
To simplify the use of these hooks and to allow users to replace subprograms in CONGEN with their own versions of said subprograms, the makefile, $CGS/usermake, has been provided for Unix, and the equivalent MMS descriptor file, CGS:USERMAKE.MMS has been provided on VMS. These makefiles will produce a private version of CONGEN in your default directory using your version of usersb.flx. If you need to change more files, then copy usermake into your working directory, and modify it accordingly.
Before attempting to write your own user functions, you should familiarize yourself with the information available on the implementation of CONGEN, see Implementation.
There are several utility routines available to a user routine. Some of them are listed below.
CALL GETE(X,Y,Z) will cause the energy and forces to be computed
and values are saved in the appropriate common blocks. For this to work
CODES must have been
called. This can be done by executing both the NBONds and
HBONds command, or by having previously found the energy
(minimization, dynamics, etc.).
CALL PRINTE(IUNIT,ICYCLE,LHDR) will write the current energy
values (from common block values) to the specified unit,
It will also write out the cycle or iteration number,
optionally write out the standard header if