If the set of basic functions provided by the system as listed below is not sufficient for your own purpose, it is possible to define user functions. To do this, the user has to provide the code of the function(s) as a FORTRAN routine, in his own area, in files named USER00.FOR,... USER09.FOR. The command CREATE/FUNCTION will compile the routine(s) and link them with the corresponding system programs (primitives). A library with the local definitions of the routines USER00,..., USER09 and the executable code will be created in the user area. With this scheme, it is possible to fit the external functions USER0i as if they where basic functions.
Here is a template to write a user defined function:
C+ C.NAME C USER0i C C.DESCRIPTION C ... C C.INPUT ARGUMENTS: C NIND INTEGER Number of independent variables C X (NIND) REAL Array of NIND elements with the C independent variable C NPAR INTEGER Number of parameters C PARAM (NPAR) DOUBLE PRECISION Array of NPAR elements with the C values of the parameters C C.OUTPUT ARGUMENTS: C Y DOUBLE PRECISION Value of the function C DERIV (NPAR) DOUBLE PRECISION Array of NPAR elements with the C partial derivatives of the C function for each parameter C- SUBROUTINE USER0i(NIND,X,NPAR,PARAM,Y,DERIV) IMPLICIT NONE C .. C .. Scalar Arguments .. INTEGER NIND,NPAR DOUBLE PRECISION Y C .. C .. Array Arguments .. REAL X(NIND) DOUBLE PRECISION DERIV(NPAR),PARAM(NPAR) C .. C .. Local Scalars .. C .. C .. Local Arrays .. C .. C .. Executable Statements RETURN ENDThe variable Y must contain the value of the basic function at the parameter value PARAM and the array DERIV has to receive the value of the partial derivatives, except if the method used is CGNND (the abbreviation of Corrected Gauss--Newton No Derivative). In the user functions, it is recommended to scale the parameters in such a way that their absolute values lies in a small scale range let us say in . It is advised to use this scheme to test and debug new functions that can later on be included in the system supported set.