INCLAN: intrinsics: Difference between revisions

From CYANA Wiki
Jump to navigation Jump to search
m (1 revision)
No edit summary
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The following functions can be used in FORTRAN-77 expressions in addition to the standard [http://www.fortran.com/F77_std/rjcnf-15.html#sh-15.10 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. The result type of the function is given in parentheses.
;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: ''&chi;''<sup>2</sup> 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 ''&chi;''<sup>2</sup> value of the last linear 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)


The following functions can be used in FORTRAN-77 expressions in addition
;plotx0, ploty0, plotx1, ploty1: coordinates of the two reference points in the user coordinate system used for graphics (real)
to the standard FORTRAN-77 intrinsic functions or anywhere on the command
 
line in the form $''function''(''parameter'',''parameter'',...) if there are
;rand: random number between 0 and 1 (real)
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
;rand(''i''): random number between 0 and 1, using seed ''i'' (real)
character expressions.
 
;rand(''i'',''n''): ''n''-th random number between 0 and 1, using seed ''i'' (real)
function      result    description
 
--------      -------    ---------------------------------------------------
;time: current time in the form hh:mm:ss (character)
cputime      real      CPU time in seconds since the start of the program
 
date          character  current date in the form dd-mm-yy
;val(''s''): value of the variable with name s, or a blank string if no variable with this name exists. (character)
def(s)        logical    does a variable with name s exist and have a value
 
                        different from NULL?
;val(''s'',''t''): value of the variable with name ''s'', or ''t'' if no variable with this name exists. (character)
exist(s)      logical    does a variable with name s exist?
 
existfile(s)  logical    does a file with name s exist?
;walltime: wallclock time in s since the start of the program (integer)
external(s)  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 a blank string if
                        no external variable with this name exists.
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

Latest revision as of 22:39, 12 August 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. The result type of the function is given in parentheses.

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 last linear 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 the variable 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)