c ************************************************************************ c * c * sysfun.f - c * c * Copyright (c) 1995 c * c * ETH Zuerich c * Institut fuer Molekularbiologie und Biophysik c * ETH-Hoenggerberg c * CH-8093 Zuerich c * c * All Rights Reserved c * c * Date of last modification : 95/09/15 c * Pathname of SCCS file : /export/home3/cb/garant-1.0/src/SCCS/s.sysfun.f c * SCCS identification : 1.3 c * c ************************************************************************ c ================================================================== c SYSFUN: Evaluate external (non-Fortran) functions. c c Peter G"untert, 12-08-1994 c ------------------------------------------------------------------ subroutine sysfun (func,iarg,narg,inum,rnum,cnum,snum,numtyp) c character*(*) func,snum(*) dimension iarg(*),inum(*),rnum(*),numtyp(*) complex cnum(*),c c i1=iarg(1) c -------------------------------------- functions without arguments if (narg.eq.0) then numtyp(i1)=1 if (func.eq.'pi') then rnum(i1)=3.141592654 numtyp(i1)=2 else go to 900 end if c ---------------------- functions with variable number of arguments c else if (func.eq.'sval') then c -------------------------------------- functions with one argument else if (narg.eq.1) then c ............................ functions with one integer argument if (numtyp(i1).eq.1) then i=inum(i1) if (func.eq.'idummy') then inum(i1)=2*i else rnum(i1)=i numtyp(i1)=2 go to 200 end if go to 800 end if c ............................... functions with one real argument 200 if (numtyp(i1).eq.2) then r=rnum(i1) if (func.eq.'rdummy') then rnum(i1)=2.0*r else cnum(i1)=c numtyp(i1)=3 go to 300 end if go to 800 end if c ............................ functions with one complex argument 300 if (numtyp(i1).eq.3) then c=cnum(i1) if (func.eq.'cdummy') then cnum(i1)=2.0*c else go to 900 end if go to 800 c .......................... functions with one character argument else if (numtyp(i1).eq.4) then if (func.eq.'sdummy') then numtyp(i1)=1 else go to 900 end if go to 800 end if go to 900 c -------------------------------------------------- other functions else go to 900 end if 800 return c ------------------------------------------------------------ error 900 numtyp(i1)=0 end