INCLAN: intrinsics: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
No edit summary  | 
				No edit summary  | 
				||
| (6 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
The following functions can be used in FORTRAN-77 expressions in addition    | 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  | ||
to the standard FORTRAN-77 intrinsic functions or anywhere on the command  | 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.  | ||
line in the form $''function''(''parameter'',''parameter'',...) if there are  | |||
parameters or in the form $''function'' without parameters. In the   | |||
character expressions.    | |||
;cputime: CPU time in seconds since the start of the program (real)  | |||
;cputime:   | ;date: current date in the form dd-mm-yy (character)  | ||
;date:   | |||
def(s)   | ;def(''s''): does a variable with name ''s'' exist and have a value different from NULL? (logical)  | ||
exist(s)   | ;exist(''s''): does a variable with name ''s'' exist? (logical)  | ||
existfile(s)   | |||
external(s)   | ;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)   | ;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: ''χ''<sup>2</sup> value of the last linear least-squares fit (real)  | |||
fitchisq   | ;fiterr(''n''): standard deviation of the ''n''-th fit parameter of the last linear least-squares fit (real)  | ||
fiterr(n)   | |||
;fitpar(''n''): optimal value of the ''n''-th fit parameter of the last linear least-squares fit (real)  | |||
fitpar(n)   | |||
;fitprob: probability that the ''χ''<sup>2</sup> value of the last linear least-squares fit would be exceeded by chance (real)  | |||
fitprob   | |||
;getenv(''s''): value of Unix environment variable with name ''s'' (character)  | |||
getenv(s)   | ;getpid: Unix PID of current process (integer)  | ||
getpid   | |||
global(s)   | ;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)  | |||
global(s,t)   | ;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)  | |||
if(n,x1,x2)   | |||
;lenstr(''s''): length of string s (without trailing blanks) (integer)  | |||
length(s)   | ;macro(''s''): does a macro with name ''s'' exist in the search path? (logical)  | ||
lenstr(s)   | |||
macro(s)   | ;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)  | ||
match(s,t)   | |||
;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)  | |||
mtime(s)   | |||
;plotx0, ploty0, plotx1, ploty1: coordinates of the two reference points in the user coordinate system used for graphics (real)  | |||
opened(s)   | |||
plotx0,    | ;rand: random number between 0 and 1 (real)  | ||
ploty0,  | |||
plotx1,    | ;rand(''i''): random number between 0 and 1, using seed ''i'' (real)  | ||
ploty1   | |||
;rand(''i'',''n''): ''n''-th random number between 0 and 1, using seed ''i'' (real)  | |||
rand   | |||
rand(i)   | ;time: current time in the form hh:mm:ss (character)  | ||
rand(i,n)   | |||
time   | ;val(''s''): value of the variable with name s, or a blank string if no variable with this name exists. (character)  | ||
val(s)   | |||
;val(''s'',''t''): value of the variable with name ''s'', or ''t'' if no variable with this name exists. (character)  | |||
val(s,t)   | |||
;walltime: wallclock time in s since the start of the program (integer)  | |||
walltime   | |||
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)