Several Hints for the Fortran Cex Programmer
Contributed by David Spellmeyer (and many others who've helped me determine the answers to these many problems)
HINT Number 1:
DECLARE YOUR CEX VARIABLES!
HINT Number 2:
DECLARE YOUR CEX VARIABLES!
HINT Number 3:
DECLARE YOUR CEX VARIABLES!
Hint number 4:
The CEX-FORTRAN include files are in the directory: "$CX_ROOT/include/" Currently, the files to include are: cx_f.inc cx_f_molecule.inc cx_f_surface.inc
The first two should be included in the order shown. The cx_f.inc includes many declarations needed for the cex objects. cx_f_molecule.inc includes several definitions for the molecule objects that you'll need.
Note that many of the cex routines are declared because of the amount of time wasted trying to feret out undeclared variables. This represents a trade-off of convenience with memory, since each declaration does require a memory location. On modern machines, this seems a fair trade-off.
Hint number 5:
All cex subroutine and function calls are passed through the fortran-to-c wrappers. In general, the function calls will all return integers. The names of the c routines and the FORTRAN routines are related: cx_send (a c-routine) becomes cx_f_send, which is the FORTRAN wrapper.
The fortran-to-c wrappers are c routines that are stored in: $CX_ROOT/src/wrappers/f77/
Hint number 6:
The cex input and output streams are on units 5 and 6. Therefore, it is a good idea to open other units for the input and output from your FORTRAN program.
Hint number 7:
It's a good programming practice (that I don't ALWAYS follow) to make sure that return status conditionals use "NULL" if appropriate, and an integer "0" if appropriate. This is consistent with the C coding scheme.