⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 intrinsic.texi

📁 gcc-fortran,linux使用fortran的编译软件。很好用的。
💻 TEXI
📖 第 1 页 / 共 5 页
字号:
@item @emph{Class}:elemental function@item @emph{Syntax}:@code{X = AINT(X)} @code{X = AINT(X, KIND)}@item @emph{Arguments}:@multitable @columnfractions .15 .80@item @var{X}    @tab The type of the argument shall be @code{REAL(*)}.@item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integerinitialization expression.@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 .24 .24 .24 .24@item Name           @tab Argument         @tab Return type      @tab Option@item @code{DINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)}   @tab f95, gnu@end multitable@end table@node ALARM@section @code{ALARM} --- Execute a routine after a given delay@findex @code{ALARM} intrinsic@table @asis@item @emph{Description}:@code{ALARM(SECONDS [, STATUS])} causes external subroutine @var{HANDLER}to be executed after a delay of @var{SECONDS} by using @code{alarm(1)} 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{Option}:gnu@item @emph{Class}:subroutine@item @emph{Syntax}:@code{CALL ALARM(SECONDS, HANDLER)} @code{CALL ALARM(SECONDS, HANDLER, STATUS)}@item @emph{Arguments}:@multitable @columnfractions .15 .80@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.@code{INTEGER}. It is @code{INTENT(IN)}.@item @var{STATUS}  @tab (Optional) @var{STATUS} shall be a scalar@code{INTEGER} variable. 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 smallexampleThis will cause the external routine @var{handler_print} to be calledafter 3 seconds.@end table@node ALL@section @code{ALL} --- All values in @var{MASK} along @var{DIM} are true @findex @code{ALL} intrinsic@cindex true values@table @asis@item @emph{Description}:@code{ALL(MASK [, DIM])} determines if all the values are true in @var{MASK}in the array along dimension @var{DIM}.@item @emph{Option}:f95, gnu@item @emph{Class}:transformational function@item @emph{Syntax}:@code{L = ALL(MASK)} @code{L = ALL(MASK, DIM)}@item @emph{Arguments}:@multitable @columnfractions .15 .80@item @var{MASK} @tab The type of the argument shall be @code{LOGICAL(*)} andit shall not be scalar.@item @var{DIM}  @tab (Optional) @var{DIM} shall be a scalar integerwith a value that lies between one and the rank of @var{MASK}.@end multitable@item @emph{Return value}:@code{ALL(MASK)} returns a scalar value of type @code{LOGICAL(*)} wherethe kind type parameter is the same as the kind type parameter of@var{MASK}.  If @var{DIM} is present, then @code{ALL(MASK, DIM)} returnsan array with the rank of @var{MASK} minus 1.  The shape is determined fromthe shape of @var{MASK} where the @var{DIM} dimension is elided. @table @asis@item (A)@code{ALL(MASK)} is true if all elements of @var{MASK} are true.It also is true if @var{MASK} has zero size; otherwise, it is false.@item (B)If the rank of @var{MASK} is one, then @code{ALL(MASK,DIM)} is equivalentto @code{ALL(MASK)}.  If the rank is greater than one, then @code{ALL(MASK,DIM)}is determined by applying @code{ALL} to the array sections.@end table@item @emph{Example}:@smallexampleprogram test_all  logical l  l = all((/.true., .true., .true./))  print *, l  call section  contains    subroutine section      integer a(2,3), b(2,3)      a = 1      b = 1      b(2,2) = 2      print *, all(a .eq. b, 1)      print *, all(a .eq. b, 2)    end subroutine sectionend program test_all@end smallexample@end table@node ALLOCATED@section @code{ALLOCATED} --- Status of an allocatable entity@findex @code{ALLOCATED} intrinsic@cindex allocation status@table @asis@item @emph{Description}:@code{ALLOCATED(X)} checks the status of whether @var{X} is allocated.@item @emph{Option}:f95, gnu@item @emph{Class}:inquiry function@item @emph{Syntax}:@code{L = ALLOCATED(X)}@item @emph{Arguments}:@multitable @columnfractions .15 .80@item @var{X}    @tab The argument shall be an @code{ALLOCATABLE} array.@end multitable@item @emph{Return value}:The return value is a scalar @code{LOGICAL} with the default logicalkind type parameter.  If @var{X} is allocated, @code{ALLOCATED(X)}is @code{.TRUE.}; otherwise, it returns the @code{.TRUE.} @item @emph{Example}:@smallexampleprogram test_allocated  integer :: i = 4  real(4), allocatable :: x(:)  if (allocated(x) .eqv. .false.) allocate(x(i)end program test_allocated@end smallexample@end table@node ANINT@section @code{ANINT} --- Imaginary part of complex number  @findex @code{ANINT} intrinsic@findex @code{DNINT} intrinsic@cindex whole number@table @asis@item @emph{Description}:@code{ANINT(X [, KIND])} rounds its argument to the nearest whole number.@item @emph{Option}:f95, gnu@item @emph{Class}:elemental function@item @emph{Syntax}:@code{X = ANINT(X)}@code{X = ANINT(X, KIND)}@item @emph{Arguments}:@multitable @columnfractions .15 .80@item @var{X}    @tab The type of the argument shall be @code{REAL(*)}.@item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integerinitialization expression.@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 @var{X} is greater thanzero, then @code{ANINT(X)} returns @code{AINT(X+0.5)}.  If @var{X} isless than or equal to zero, then return @code{AINT(X-0.5)}.@item @emph{Example}:@smallexampleprogram test_anint  real(4) x4  real(8) x8  x4 = 1.234E0_4  x8 = 4.321_8  print *, anint(x4), dnint(x8)  x8 = anint(x4,8)end program test_anint@end smallexample@item @emph{Specific names}:@multitable @columnfractions .24 .24 .24 .24@item Name            @tab Argument         @tab Return type      @tab Option@item @code{DNINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)}   @tab f95, gnu@end multitable@end table@node ANY@section @code{ANY} --- Any value in @var{MASK} along @var{DIM} is true @findex @code{ANY} intrinsic@cindex true values@table @asis@item @emph{Description}:@code{ANY(MASK [, DIM])} determines if any of the values in the logical array@var{MASK} along dimension @var{DIM} are @code{.TRUE.}.@item @emph{Option}:f95, gnu@item @emph{Class}:transformational function@item @emph{Syntax}:@code{L = ANY(MASK)} @code{L = ANY(MASK, DIM)}@item @emph{Arguments}:@multitable @columnfractions .15 .80@item @var{MASK} @tab The type of the argument shall be @code{LOGICAL(*)} andit shall not be scalar.@item @var{DIM}  @tab (Optional) @var{DIM} shall be a scalar integerwith a value that lies between one and the rank of @var{MASK}.@end multitable@item @emph{Return value}:@code{ANY(MASK)} returns a scalar value of type @code{LOGICAL(*)} wherethe kind type parameter is the same as the kind type parameter of@var{MASK}.  If @var{DIM} is present, then @code{ANY(MASK, DIM)} returnsan array with the rank of @var{MASK} minus 1.  The shape is determined fromthe shape of @var{MASK} where the @var{DIM} dimension is elided. @table @asis@item (A)@code{ANY(MASK)} is true if any element of @var{MASK} is true;otherwise, it is false.  It also is false if @var{MASK} has zero size.@item (B)If the rank of @var{MASK} is one, then @code{ANY(MASK,DIM)} is equivalentto @code{ANY(MASK)}.  If the rank is greater than one, then @code{ANY(MASK,DIM)}is determined by applying @code{ANY} to the array sections.@end table@item @emph{Example}:@smallexampleprogram test_any  logical l  l = any((/.true., .true., .true./))  print *, l  call section  contains    subroutine section      integer a(2,3), b(2,3)      a = 1      b = 1      b(2,2) = 2      print *, any(a .eq. b, 1)      print *, any(a .eq. b, 2)    end subroutine sectionend program test_any@end smallexample@end table@node ASIN@section @code{ASIN} --- Arcsine function @findex @code{ASIN} intrinsic@findex @code{DASIN} intrinsic@cindex arcsine@table @asis@item @emph{Description}:@code{ASIN(X)} computes the arcsine of its @var{X}.@item @emph{Option}:f95, gnu@item @emph{Class}:elemental function@item @emph{Syntax}:@code{X = ASIN(X)}@item @emph{Arguments}:@multitable @columnfractions .15 .80@item @var{X} @tab The type shall be @code{REAL(*)}, and 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{-\pi / 2 \leq \arccos (x) \leq \pi / 2}.  The kind typeparameter is the same as @var{X}.@item @emph{Example}:@smallexampleprogram test_asin  real(8) :: x = 0.866_8  x = asin(x)end program test_asin@end smallexample@item @emph{Specific names}:@multitable @columnfractions .24 .24 .24 .24@item Name            @tab Argument          @tab Return type       @tab Option@item @code{DASIN(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu@end multitable@end table@node ASSOCIATED@section @code{ASSOCIATED} --- Status of a pointer or pointer/target pair @findex @code{ASSOCIATED} intrinsic@cindex pointer status@table @asis@item @emph{Description}:@code{ASSOCIATED(PTR [, TGT])} determines the status of the pointer @var{PTR}or if @var{PTR} is associated with the target @var{TGT}.@item @emph{Option}:f95, gnu@item @emph{Class}:inquiry function@item @emph{Syntax}:@code{L = ASSOCIATED(PTR)} @code{L = ASSOCIATED(PTR [, TGT])}@item @emph{Arguments}:@multitable @columnfractions .15 .80@item @var{PTR} @tab @var{PTR} shall have the @code{POINTER} attribute andit can be of any type.@item @var{TGT} @tab (Optional) @var{TGT} shall be a @code{POINTER} ora @code{TARGET}.  It must have the same type, kind type parameter, andarray rank as @var{PTR}.@end multitableThe status of neither @var{PTR} nor @var{TGT} can be undefined.@item @emph{Return value}:@code{ASSOCIATED(PTR)} returns a scalar value of type @code{LOGICAL(4)}.There are several cases:@table @asis@item (A) If the optional @var{TGT} is not present, then @code{ASSOCIATED(PTR)}is true if @var{PTR} is associated with a target; otherwise, it returns false.@item (B) If @var{TGT} is present and a scalar target, the result is true if@var{TGT}is not a 0 sized storage sequence and the target associated with @var{PTR}occupies the same storage units.  If @var{PTR} is disassociated, then the result is false.@item (C) If @var{TGT} is present and an array target, the result is true if@var{TGT} and @var{PTR} have the same shape, are not 0 sized arrays, arearrays whose elements are not 0 sized storage sequences, and @var{TGT} and@var{PTR} occupy the same storage units in array element order.As in case(B), the result is false, if @var{PTR} is disassociated.@item (D) If @var{TGT} is present and an scalar pointer, the result is true iftarget associated with @var{PTR} and the target associated with @var{TGT}are not 0 sized storage sequences and occupy the same storage units.The result is false, if either @var{TGT} or @var{PTR} is disassociated.@item (E) If @var{TGT} is present and an array pointer, the result is true iftarget associated with @var{PTR} and the target associated with @var{TGT}have the same shape, are not 0 sized arrays, are arrays whose elements arenot 0 sized storage sequences, and @var{TGT} and @var{PTR} occupy the samestorage units in array element order.The result is false, if either @var{TGT} or @var{PTR} is disassociated.@end table@item @emph{Example}:@smallexampleprogram test_associated   implicit none   real, target  :: tgt(2) = (/1., 2./)   real, pointer :: ptr(:)   ptr => tgt   if (associated(ptr)     .eqv. .false.) call abort   if (associated(ptr,tgt) .eqv. .false.) call abortend program test_associated@end smallexample@end table@node ATAN@section @code{ATAN} --- Arctangent function @findex @code{ATAN} intrinsic@findex @code{DATAN} intrinsic@cindex arctangent@table @asis@item @emph{Description}:@code{ATAN(X)} computes the arctangent of @var{X}.@item @emph{Option}:f95, gnu@item @emph{Class}:elemental function@item @emph{Syntax}:@code{X = ATAN(X)}@item @emph{Arguments}:@multitable @columnfractions .15 .80@item @var{X} @tab The type shall be @code{REAL(*)}.@end multitable@item @emph{Return value}:The return value is of type @code{REAL(*)} and it lies in therange @math{ - \pi / 2 \leq \arcsin (x) \leq \pi / 2}.@item @emph{Example}:@smallexampleprogram test_atan  real(8) :: x = 2.866_8  x = atan(x)end program test_atan

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -