INCLAN: intrinsics: Difference between revisions

From CYANA Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:
   
   
;cputime: CPU time in seconds since the start of the program (real)
;cputime: CPU time in seconds since the start of the program (real)
;date: current date in the form dd-mm-yy (character)
;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)
;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)
;exist(''s''): does a variable with name ''s'' exist? (logical)
;existfile(''s''): does a file 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  
;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)
                        with name s (even if it is hidden by a local  
 
                        variable with the same name), or t if no external
;external(''s'',''t''): 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. (character)
                        variable with this name exists.
 
fitchisq     real      chi^2 value of the last linear least-squares fit
;fitchisq: ''&chi;''<sup>2</sup> value of the last linear least-squares fit (real)
fiterr(n)     real      standard deviation of the n-th fit parameter of  
 
                        the last linear least-squares fit
;fiterr(''n''): standard deviation of the ''n''-th fit parameter of the last linear least-squares fit (real)
fitpar(n)     real      optimal value of the n-th fit parameter of the  
 
                        last linear least-squares fit
;fitpar(''n''): optimal value of the ''n''-th fit parameter of the last linear least-squares fit (real)
fitprob       real      probability that the chi^2 value of the last
 
                        linear least-squares fit would be exceeded by
;fitprob: probability that the ''&chi;''<sup>2</sup> value of the lastlinear least-squares fit would be exceeded by chance (real)
                        chance
 
getenv(s)     character  value of Unix environment variable with name s
;getenv(''s''): value of Unix environment variable with name ''s'' (character)
getpid       integer    Unix PID of current process
 
global(s)     character  value of the global with name s (even if it is  
;getpid: Unix PID of current process (integer)
                        hidden by a local variable with the same name),  
 
                        or a blank string if no global variable with
;global(''s'') 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. (character)
                        this name exists.
 
global(s,t)   character  value of the global with name s (even if it is  
;global(''s'',''t''): 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. (character)
                        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.
if(n,x1,x2)   -          argument x1 if the condition n is true, or x2
 
                        otherwise. The arguments x1 and x2 can have any  
;length(''s''): number of elements of the variable with name ''s'' (integer)
                        type.
 
length(s)     integer    number of elements of the variable with name s
;lenstr(''s''): length of string s (without trailing blanks) (integer)
lenstr(s)     integer    length of string s (without trailing blanks)
 
macro(s)     logical    does a macro with name s exist in the search path?
;macro(''s''): does a macro with name ''s'' exist in the search path? (logical)
match(s,t)   logical    does the string s match the string t? The string t
 
                        may contain wildcards: an asterisk matches zero  
;match(''s'',''t''): 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. (logical)
                        or more characters, and a question mark matches  
 
                        exactly one character.
;mtime(''s''): time of last modification (in seconds since a reference date) of the file with name ''s'' (integer)
mtime(s)     integer    time of last modification (in seconds since a  
 
                        reference date) of the file with name s
;opened(''s''): is the file with name ''s'' open? (logical)
opened(s)     logical    is the file with name s open?
 
plotx0,  
;plotx0, ploty0, plotx1, ploty1: coordinates of the two reference points in the user coordinate system used for graphics (real)
ploty0,
 
plotx1,  
;rand: random number between 0 and 1 (real)
ploty1       real      coordinates of the two reference points in the  
 
                        user coordinate system used for graphics
;rand(''i''): random number between 0 and 1, using seed ''i'' (real)
rand         real      random number between 0 and 1
 
rand(i)       real      random number between 0 and 1, using seed i
;rand(''i'',''n''): ''n''-th random number between 0 and 1, using seed ''i'' (real)
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
;time: current time in the form hh:mm:ss (character)
val(s)       character  value of the variable with name s, or a blank  
 
                        string if no variable with this name exists.
;val(''s''): value of the variable with name s, or a blank string if no variable with this name exists. (character)
val(s,t)     character  value of thevariable with name s, or t if no  
 
                        variable with this name exists.
;val(''s'',''t''): value of thevariable with name ''s'', or ''t'' if no variable with this name exists. (character)
walltime     integer    wallclock time in s since the start of the program
 
;walltime: wallclock time in s since the start of the program (integer)

Revision as of 10:39, 30 January 2009

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 alphabetical 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)
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. (character)
fitchisq
χ2 value of the last linear least-squares fit (real)
fiterr(n)
standard deviation of the n-th fit parameter of the last linear least-squares fit (real)
fitpar(n)
optimal value of the n-th fit parameter of the last linear least-squares fit (real)
fitprob
probability that the χ2 value of the lastlinear least-squares fit would be exceeded by chance (real)
getenv(s)
value of Unix environment variable with name s (character)
getpid
Unix PID of current process (integer)
global(s) 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. (character)
global(s,t)
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. (character)
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)
number of elements of the variable with name s (integer)
lenstr(s)
length of string s (without trailing blanks) (integer)
macro(s)
does a macro with name s exist in the search path? (logical)
match(s,t)
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. (logical)
mtime(s)
time of last modification (in seconds since a reference date) of the file with name s (integer)
opened(s)
is the file with name s open? (logical)
plotx0, ploty0, plotx1, ploty1
coordinates of the two reference points in the user coordinate system used for graphics (real)
rand
random number between 0 and 1 (real)
rand(i)
random number between 0 and 1, using seed i (real)
rand(i,n)
n-th random number between 0 and 1, using seed i (real)
time
current time in the form hh:mm:ss (character)
val(s)
value of the variable with name s, or a blank string if no variable with this name exists. (character)
val(s,t)
value of thevariable with name s, or t if no variable with this name exists. (character)
walltime
wallclock time in s since the start of the program (integer)