📄 intrinsic.texi
字号:
may be any concatenation of @code{"r"} (readable), @code{"w"} (writable)and @code{"x"} (executable), or @code{" "} to check for existence.@end multitable@item @emph{Return value}:Returns a scalar @code{INTEGER}, which is @code{0} if the file isaccessible in the given mode; otherwise or if an invalid argumenthas been given for @code{MODE} the value @code{1} is returned.@item @emph{Example}:@smallexampleprogram access_test implicit none character(len=*), parameter :: file = 'test.dat' character(len=*), parameter :: file2 = 'test.dat '//achar(0) if(access(file,' ') == 0) print *, trim(file),' is exists' if(access(file,'r') == 0) print *, trim(file),' is readable' if(access(file,'w') == 0) print *, trim(file),' is writable' if(access(file,'x') == 0) print *, trim(file),' is executable' if(access(file2,'rwx') == 0) & print *, trim(file2),' is readable, writable and executable'end program access_test@end smallexample@item @emph{Specific names}:@item @emph{See also}:@end table@node ACHAR@section @code{ACHAR} --- Character in @acronym{ASCII} collating sequence @fnindex ACHAR@cindex @acronym{ASCII} collating sequence@cindex collating sequence, @acronym{ASCII}@table @asis@item @emph{Description}:@code{ACHAR(I)} returns the character located at position @code{I}in the @acronym{ASCII} collating sequence.@item @emph{Standard}:F77 and later@item @emph{Class}:Elemental function@item @emph{Syntax}:@code{RESULT = ACHAR(I)}@item @emph{Arguments}:@multitable @columnfractions .15 .70@item @var{I} @tab The type shall be @code{INTEGER(*)}.@end multitable@item @emph{Return value}:The return value is of type @code{CHARACTER} with a length of one. Thekind type parameter is the same as @code{KIND('A')}.@item @emph{Example}:@smallexampleprogram test_achar character c c = achar(32)end program test_achar@end smallexample@item @emph{Note}:See @ref{ICHAR} for a discussion of converting between numerical valuesand formatted string representations.@item @emph{See also}:@ref{CHAR}, @ref{IACHAR}, @ref{ICHAR}@end table@node ACOS@section @code{ACOS} --- Arccosine function @fnindex ACOS@fnindex DACOS@cindex trigonometric function, cosine, inverse@cindex cosine, inverse@table @asis@item @emph{Description}:@code{ACOS(X)} computes the arccosine of @var{X} (inverse of @code{COS(X)}).@item @emph{Standard}:F77 and later@item @emph{Class}:Elemental function@item @emph{Syntax}:@code{RESULT = ACOS(X)}@item @emph{Arguments}:@multitable @columnfractions .15 .70@item @var{X} @tab The type shall be @code{REAL(*)} with a magnitude that isless than one.@end multitable@item @emph{Return value}:The return value is of type @code{REAL(*)} and it lies in therange @math{ 0 \leq \acos(x) \leq \pi}. The kind type parameter is the same as @var{X}.@item @emph{Example}:@smallexampleprogram test_acos real(8) :: x = 0.866_8 x = acos(x)end program test_acos@end smallexample@item @emph{Specific names}:@multitable @columnfractions .20 .20 .20 .25@item Name @tab Argument @tab Return type @tab Standard@item @code{DACOS(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab F77 and later@end multitable@item @emph{See also}:Inverse function: @ref{COS}@end table@node ACOSH@section @code{ACOSH} --- Hyperbolic arccosine function@fnindex ACOSH@fnindex DACOSH@cindex area hyperbolic cosine@cindex hyperbolic arccosine@cindex hyperbolic function, cosine, inverse@cindex cosine, hyperbolic, inverse@table @asis@item @emph{Description}:@code{ACOSH(X)} computes the hyperbolic arccosine of @var{X} (inverse of@code{COSH(X)}).@item @emph{Standard}:GNU extension@item @emph{Class}:Elemental function@item @emph{Syntax}:@code{RESULT = ACOSH(X)}@item @emph{Arguments}:@multitable @columnfractions .15 .70@item @var{X} @tab The type shall be @code{REAL(*)} with a magnitude that isgreater or equal to one.@end multitable@item @emph{Return value}:The return value is of type @code{REAL(*)} and it lies in therange @math{0 \leq \acosh (x) \leq \infty}.@item @emph{Example}:@smallexamplePROGRAM test_acosh REAL(8), DIMENSION(3) :: x = (/ 1.0, 2.0, 3.0 /) WRITE (*,*) ACOSH(x)END PROGRAM@end smallexample@item @emph{Specific names}:@multitable @columnfractions .20 .20 .20 .25@item Name @tab Argument @tab Return type @tab Standard@item @code{DACOSH(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab GNU extension@end multitable@item @emph{See also}:Inverse function: @ref{COSH}@end table@node ADJUSTL@section @code{ADJUSTL} --- Left adjust a string @fnindex ADJUSTL@cindex string, adjust left@cindex adjust string@table @asis@item @emph{Description}:@code{ADJUSTL(STR)} will left adjust a string by removing leading spaces.Spaces are inserted at the end of the string as needed.@item @emph{Standard}:F95 and later@item @emph{Class}:Elemental function@item @emph{Syntax}:@code{RESULT = ADJUSTL(STR)}@item @emph{Arguments}:@multitable @columnfractions .15 .70@item @var{STR} @tab The type shall be @code{CHARACTER}.@end multitable@item @emph{Return value}:The return value is of type @code{CHARACTER} where leading spaces are removed and the same number of spaces are inserted on the endof @var{STR}.@item @emph{Example}:@smallexampleprogram test_adjustl character(len=20) :: str = ' gfortran' str = adjustl(str) print *, strend program test_adjustl@end smallexample@item @emph{See also}:@ref{ADJUSTR}, @ref{TRIM}@end table@node ADJUSTR@section @code{ADJUSTR} --- Right adjust a string @fnindex ADJUSTR@cindex string, adjust right@cindex adjust string@table @asis@item @emph{Description}:@code{ADJUSTR(STR)} will right adjust a string by removing trailing spaces.Spaces are inserted at the start of the string as needed.@item @emph{Standard}:F95 and later@item @emph{Class}:Elemental function@item @emph{Syntax}:@code{RESULT = ADJUSTR(STR)}@item @emph{Arguments}:@multitable @columnfractions .15 .70@item @var{STR} @tab The type shall be @code{CHARACTER}.@end multitable@item @emph{Return value}:The return value is of type @code{CHARACTER} where trailing spaces are removed and the same number of spaces are inserted at the startof @var{STR}.@item @emph{Example}:@smallexampleprogram test_adjustr character(len=20) :: str = 'gfortran' str = adjustr(str) print *, strend program test_adjustr@end smallexample@item @emph{See also}:@ref{ADJUSTL}, @ref{TRIM}@end table@node AIMAG@section @code{AIMAG} --- Imaginary part of complex number @fnindex AIMAG@fnindex DIMAG@fnindex IMAG@fnindex IMAGPART@cindex complex numbers, imaginary part@table @asis@item @emph{Description}:@code{AIMAG(Z)} yields the imaginary part of complex argument @code{Z}.The @code{IMAG(Z)} and @code{IMAGPART(Z)} intrinsic functions are providedfor compatibility with @command{g77}, and their use in new code is strongly discouraged.@item @emph{Standard}:F77 and later, has overloads that are GNU extensions@item @emph{Class}:Elemental function@item @emph{Syntax}:@code{RESULT = AIMAG(Z)}@item @emph{Arguments}:@multitable @columnfractions .15 .70@item @var{Z} @tab The type of the argument shall be @code{COMPLEX(*)}.@end multitable@item @emph{Return value}:The return value is of type real with thekind type parameter of the argument.@item @emph{Example}:@smallexampleprogram test_aimag complex(4) z4 complex(8) z8 z4 = cmplx(1.e0_4, 0.e0_4) z8 = cmplx(0.e0_8, 1.e0_8) print *, aimag(z4), dimag(z8)end program test_aimag@end smallexample@item @emph{Specific names}:@multitable @columnfractions .20 .20 .20 .25@item Name @tab Argument @tab Return type @tab Standard@item @code{DIMAG(Z)} @tab @code{COMPLEX(8) Z} @tab @code{REAL(8)} @tab GNU extension@item @code{IMAG(Z)} @tab @code{COMPLEX(*) Z} @tab @code{REAL(*)} @tab GNU extension@item @code{IMAGPART(Z)} @tab @code{COMPLEX(*) Z} @tab @code{REAL(*)} @tab GNU extension@end multitable@end table@node AINT@section @code{AINT} --- Truncate to a whole number@fnindex AINT@fnindex DINT@cindex floor@cindex rounding, floor@table @asis@item @emph{Description}:@code{AINT(X [, KIND])} truncates its argument to a whole number.@item @emph{Standard}:F77 and later@item @emph{Class}:Elemental function@item @emph{Syntax}:@code{RESULT = AINT(X [, KIND])} @item @emph{Arguments}:@multitable @columnfractions .15 .70@item @var{X} @tab The type of the argument shall be @code{REAL(*)}.@item @var{KIND} @tab (Optional) An @code{INTEGER(*)} initialization expression indicating the kind parameter of the result.@end multitable@item @emph{Return value}:The return value is of type real with the kind type parameter of theargument if the optional @var{KIND} is absent; otherwise, the kindtype parameter will be given by @var{KIND}. If the magnitude of @var{X} is less than one, then @code{AINT(X)} returns zero. If themagnitude is equal to or greater than one, then it returns the largestwhole number that does not exceed its magnitude. The sign is the sameas the sign of @var{X}. @item @emph{Example}:@smallexampleprogram test_aint real(4) x4 real(8) x8 x4 = 1.234E0_4 x8 = 4.321_8 print *, aint(x4), dint(x8) x8 = aint(x4,8)end program test_aint@end smallexample@item @emph{Specific names}:@multitable @columnfractions .20 .20 .20 .25@item Name @tab Argument @tab Return type @tab Standard@item @code{DINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab F77 and later@end multitable@end table@node ALARM@section @code{ALARM} --- Execute a routine after a given delay@fnindex ALARM@cindex delayed execution@table @asis@item @emph{Description}:@code{ALARM(SECONDS, HANDLER [, STATUS])} causes external subroutine @var{HANDLER}to be executed after a delay of @var{SECONDS} by using @code{alarm(2)} toset up a signal and @code{signal(2)} to catch it. If @var{STATUS} issupplied, it will be returned with the number of seconds remaining untilany previously scheduled alarm was due to be delivered, or zero if therewas no previously scheduled alarm.@item @emph{Standard}:GNU extension@item @emph{Class}:Subroutine@item @emph{Syntax}:@code{CALL ALARM(SECONDS, HANDLER [, STATUS])}@item @emph{Arguments}:@multitable @columnfractions .15 .70@item @var{SECONDS} @tab The type of the argument shall be a scalar@code{INTEGER}. It is @code{INTENT(IN)}.@item @var{HANDLER} @tab Signal handler (@code{INTEGER FUNCTION} or@code{SUBROUTINE}) or dummy/global @code{INTEGER} scalar. The scalar values may be either @code{SIG_IGN=1} to ignore the alarm generated or @code{SIG_DFL=0} to set the default action. It is @code{INTENT(IN)}.@item @var{STATUS} @tab (Optional) @var{STATUS} shall be a scalarvariable of the default @code{INTEGER} kind. It is @code{INTENT(OUT)}.@end multitable@item @emph{Example}:@smallexampleprogram test_alarm external handler_print integer i call alarm (3, handler_print, i) print *, i call sleep(10)end program test_alarm@end smallexample
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -