INCLAN: intrinsics

From CYANA Wiki
Revision as of 10:21, 30 January 2009 by Admin (talk | contribs)
Jump to navigation Jump to search

The following functions can be used in FORTRAN-77 expressions in addition to the standard FORTRAN-77 intrinsic functions or anywhere on the command line in the form $function(parameter,parameter,...) if there are parameters or in the form $function without parameters. In the alpha- betical list below, i and n denote integer expressions, and s and t denote character expressions.

cputime
CPU time in seconds since the start of the program (real)
date
current date in the form dd-mm-yy (character)
def(s)
does a variable with name s exist and have a value different from NULL? (logical)
exist(s)
does a variable with name s exist? (logical)
existfile(s)
does a file with name s exist? (logical)
external(s)
value of the external (i.e. non-local) variable with name s (even if it is hidden by a local variable with the same name), or a blank string if no external variable with this name exists. (character)

external(s,t) character value of the external (i.e. non-local) variable

                        with name s (even if it is hidden by a local 
                        variable with the same name), or t if no external
                        variable with this name exists.

fitchisq real chi^2 value of the last linear least-squares fit fiterr(n) real standard deviation of the n-th fit parameter of

                        the last linear least-squares fit

fitpar(n) real optimal value of the n-th fit parameter of the

                        last linear least-squares fit

fitprob real probability that the chi^2 value of the last

                        linear least-squares fit would be exceeded by
                        chance

getenv(s) character value of Unix environment variable with name s getpid integer Unix PID of current process global(s) character value of the global with name s (even if it is

                        hidden by a local variable with the same name), 
                        or a blank string if no global variable with
                        this name exists.

global(s,t) character value of the global with name s (even if it is

                        hidden by a local variable with the same name), 
                        or t if no global variable with this name exists.

if(n,x1,x2) - argument x1 if the condition n is true, or x2

                        otherwise. The arguments x1 and x2 can have any 
                        type.

length(s) integer number of elements of the variable with name s lenstr(s) integer length of string s (without trailing blanks) macro(s) logical does a macro with name s exist in the search path? match(s,t) logical does the string s match the string t? The string t

                        may contain wildcards: an asterisk matches zero 
                        or more characters, and a question mark matches 
                        exactly one character.

mtime(s) integer time of last modification (in seconds since a

                        reference date) of the file with name s

opened(s) logical is the file with name s open? plotx0, ploty0, plotx1, ploty1 real coordinates of the two reference points in the

                        user coordinate system used for graphics

rand real random number between 0 and 1 rand(i) real random number between 0 and 1, using seed i rand(i,n) real n-th random number between 0 and 1, using seed i time character current time in the form hh:mm:ss val(s) character value of the variable with name s, or a blank

                        string if no variable with this name exists.

val(s,t) character value of thevariable with name s, or t if no

                        variable with this name exists.

walltime integer wallclock time in s since the start of the program