Modifications to Optimize the EDIP Code
  by  Xianglong Yuan <yuanx@mit.edu>, April 2002 

  The main improvement is "patch.1" which further simplifies the 
  calculation of forces on coordination-changing 
  neighbors of a triplet of bonding atoms. The C code is modified only 
  to patch 1. The fortran code is available modified
  up to patch 11.  The total savings can be around 6% compared to 
  the original EDIP code (Bazant, 1997), before any compiler
  optimization (which can usually save more than 6%). 


patch.1:

  * substitute accumulation array for environment forces, sz_sum, with
    a single accumulator, dVdZ_sum, to remove a third- and a forth-
    level loops.

patch.2:

  * re-define some parameters (par_bet, par_mu, and cmbinv) to reduce
    operations.
  * initialize neighbor counts, n2, n3, and nz, to zeros to reduce
    operations and to carry correct neighbor numbers.

patch.3:

  * assign all the real constants with double precision.

patch.4:

  * reorganize a nested 2-level if-block into a simple if-block in the
    first second-level loop.

patch.5:

  * reorganize pair interaction (V2 and dV2j) calculations without
    increasing number of operations.  Useful when combining with
    external nuclear repulsion term.

patch.6:

  * reorganize 3-body radial and angular force calculations to remove
    a dozen of variables and four multiplications in a third-level loop.

patch.7:

  * calculate two 3-body prefactors before the 3-body force loop and
    reduce five multiplications in the innermost loop.

patch.8:

  * optimize three blocks of virial calculations and reduce a total of
    16 multiplications in three loops.

patch.9:

  * stylize the code.

patch.10: (a suggested patch)

  * pre-process fixZ option as being used mainly in debugging.

patch.11: (a suggested patch)

  * combine three subroutines into one, and parameterize all the
    EDIP constants into the execute code instead of using them as
    global variables.  Interface changed and now need variable
    MAX_NBRS_1, p_nbrs, and neighbors, in addition to the carry-ins.
      [Will it be more modulable by exchanging data only through
      carry-ins/outs?]

patch.12:

  * transform into DLPOLY compatible force routine.





# vim: tw=72