next up previous index
Next: XYZ-expressions Up: Calling sequences Previous: Calling the user routines

Subsections


Calling COMIS routines from a user program

The user can call a COMIS routine from a Fortran77 program using the routine's name or address. The second call is faster, but it requires the preliminary calculation of the address by

    JADP=CSADDR('NAME')

Arithmetic parameters

This section describes routines and functions which can be used for calling COMIS subroutines and functions which have only arithmetic parameters.


Calling a COMIS subroutine

CALL CSJCAL (JADP,NPAR,P1,P2,...)

where

NAME
is the name of the called COMIS routine;
JADP
is the address of the called COMIS routine;
NPAR
is the number of arguments;
P1,P2,...
are the routine's actual arguments.


Using integer COMIS functions

I = CSIJCL(JADP,NPAR,P1,P2,...)


Using real COMIS functions

R = CSRJCL(JADP,NPAR,P1,P2,...)

To speed up execution three special functions are available for the case of routines with one, two and three arguments:

    R = CSR1FN(JADP,P1)
    R = CSR2FN(JADP,P1,P2)
    R = CSR3FN(JADP,P1,P2,P3)


Using double precision COMIS functions

D = CSDJCL(JADP,NPAR,P1,P2,...)


Using complex COMIS functions

Cx = CSCJCL(JADP,NPAR,P1,P2,...)

General parameters

This section describes routines and functions which can be used for calling COMIS subroutines and functions which can have any type of parameters.


Calling a COMIS subroutine

CALL CSJSUB (JADP,STR1,P1,P2,...)
where STR and STR1 are character strings which specifies the name of called COMIS routines and the type of each parameters in argument list.


Using integer COMIS functions

I = CSIJFN(J,STR1,P1,P2,...)


Using real COMIS functions

R = CSRJFN(J,STR1,P1,P2,...)


Using double precision COMIS functions

D = CSDJFN(J,STR1,P1,P2,...)


Using complex COMIS functions

Cx = CSCJFN(J,STR1,P1,P2,...)
The parameters STR and STR1 in these routines have the forms

STR
name (parameter type description)
STR1
(parameter type description)
where ``name'' is the name of the COMIS routine which is called; ``(parameters types description)'' specifies the type of each parameter in the argument list.

Examples:

 STR = 'NAME(I,R,D,C,E,*12)'

 where  I  stands for INTEGER or LOGICAL
        R         for REAL
        D         for DOUBLE PRECISION
        C         for COMPLEX
        E         for EXTERNAL
        *12       for CHARACTER *n
If a double precision COMIS function is declared with:       FUNCTION CSDPF(R,D,C,I)
      DOUBLE CSDPF,D
      REAL R  INTEGER I
      CHARACTER *(*)C
      .....
      END
then the call from the user's routine may look like:       CHARACTER *12 TEXT
      DOUBLE PRECISION D,DP,CSDFUN
      .....
      D = CSDFUN('CSDPF(R,D,*12,I)', R, DP,TEXT,10)


next up previous index
Next: XYZ-expressions Up: Calling sequences Previous: Calling the user routines
Back to CERN | IT | ASD | CERN Program Library Home
MG (last mod. 1998-08-19)