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

📄 intrinsic.texi

📁 gcc-fortran,linux使用fortran的编译软件。很好用的。
💻 TEXI
📖 第 1 页 / 共 5 页
字号:
@item @tab @code{VALUE(2)}: @tab The month@item @tab @code{VALUE(3)}: @tab The day of the month@item @tab @code{VAlUE(4)}: @tab Time difference with UTC in minutes@item @tab @code{VALUE(5)}: @tab The hour of the day@item @tab @code{VALUE(6)}: @tab The minutes of the hour@item @tab @code{VALUE(7)}: @tab The seconds of the minute@item @tab @code{VALUE(8)}: @tab The milliseconds of the second@end multitable	    @item @emph{Option}:f95, gnu@item @emph{Class}:subroutine@item @emph{Syntax}:@code{CALL DATE_AND_TIME([DATE, TIME, ZONE, VALUES])}@item @emph{Arguments}:@multitable @columnfractions .15 .80@item @var{DATE}  @tab (Optional) The type shall be @code{CHARACTER(8)} or larger.@item @var{TIME}  @tab (Optional) The type shall be @code{CHARACTER(10)} or larger.@item @var{ZONE}  @tab (Optional) The type shall be @code{CHARACTER(5)} or larger.@item @var{VALUES}@tab (Optional) The type shall be @code{INTEGER(8)}.@end multitable@item @emph{Return value}:None@item @emph{Example}:@smallexampleprogram test_time_and_date    character(8)  :: date    character(10) :: time    character(5)  :: zone    integer,dimension(8) :: values    ! using keyword arguments    call date_and_time(date,time,zone,values)    call date_and_time(DATE=date,ZONE=zone)    call date_and_time(TIME=time)    call date_and_time(VALUES=values)    print '(a,2x,a,2x,a)', date, time, zone    print '(8i5))', valuesend program test_time_and_date@end smallexample@end table@node DBLE@section @code{DBLE} --- Double conversion function @findex @code{DBLE} intrinsic@cindex double conversion@table @asis@item @emph{Description}:@code{DBLE(X)} Converts @var{X} to double precision real type.@code{DFLOAT} is an alias for @code{DBLE}@item @emph{Option}:f95, gnu@item @emph{Class}:elemental function@item @emph{Syntax}:@code{X = DBLE(X)}@code{X = DFLOAT(X)}@item @emph{Arguments}:@multitable @columnfractions .15 .80@item @var{X} @tab The type shall be @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.@end multitable@item @emph{Return value}:The return value is of type double precision real.@item @emph{Example}:@smallexampleprogram test_dble    real    :: x = 2.18    integer :: i = 5    complex :: z = (2.3,1.14)    print *, dble(x), dble(i), dfloat(z)end program test_dble@end smallexample@end table@node DCMPLX@section @code{DCMPLX} --- Double complex conversion function@findex @code{DCMPLX} intrinsic@cindex DCMPLX@table @asis@item @emph{Description}:@code{DCMPLX(X [,Y])} returns a double complex number where @var{X} isconverted to the real component.  If @var{Y} is present it is converted to theimaginary component.  If @var{Y} is not present then the imaginary component isset to 0.0.  If @var{X} is complex then @var{Y} must not be present.@item @emph{Option}:f95, gnu@item @emph{Class}:elemental function@item @emph{Syntax}:@code{C = DCMPLX(X)}@code{C = DCMPLX(X,Y)}@item @emph{Arguments}:@multitable @columnfractions .15 .80@item @var{X} @tab The type may be @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.@item @var{Y} @tab Optional if @var{X} is not @code{COMPLEX(*)}. May be @code{INTEGER(*)} or @code{REAL(*)}. @end multitable@item @emph{Return value}:The return value is of type @code{COMPLEX(8)}@item @emph{Example}:@smallexampleprogram test_dcmplx    integer :: i = 42    real :: x = 3.14    complex :: z    z = cmplx(i, x)    print *, dcmplx(i)    print *, dcmplx(x)    print *, dcmplx(z)    print *, dcmplx(x,i)end program test_dcmplx@end smallexample@end table@node DFLOAT@section @code{DFLOAT} --- Double conversion function @findex @code{DFLOAT} intrinsic@cindex double float conversion@table @asis@item @emph{Description}:@code{DFLOAT(X)} Converts @var{X} to double precision real type.@code{DFLOAT} is an alias for @code{DBLE}.  See @code{DBLE}.@end table@node DIGITS@section @code{DIGITS} --- Significant digits function@findex @code{DIGITS} intrinsic@cindex digits, significant@table @asis@item @emph{Description}:@code{DIGITS(X)} returns the number of significant digits of the internal modelrepresentation of @var{X}.  For example, on a system using a 32-bitfloating point representation, a default real number would likely return 24.@item @emph{Option}:f95, gnu@item @emph{Class}:inquiry function@item @emph{Syntax}:@code{C = DIGITS(X)}@item @emph{Arguments}:@multitable @columnfractions .15 .80@item @var{X} @tab The type may be @code{INTEGER(*)} or @code{REAL(*)}.@end multitable@item @emph{Return value}:The return value is of type @code{INTEGER}.@item @emph{Example}:@smallexampleprogram test_digits    integer :: i = 12345    real :: x = 3.143    real(8) :: y = 2.33    print *, digits(i)    print *, digits(x)    print *, digits(y)end program test_digits@end smallexample@end table@node DIM@section @code{DIM} --- Dim function@findex @code{DIM} intrinsic@findex @code{IDIM} intrinsic@findex @code{DDIM} intrinsic@cindex dim@table @asis@item @emph{Description}:@code{DIM(X,Y)} returns the difference @code{X-Y} if the result is positive;otherwise returns zero.@item @emph{Option}:f95, gnu@item @emph{Class}:elemental function@item @emph{Syntax}:@code{X = DIM(X,Y)}@item @emph{Arguments}:@multitable @columnfractions .15 .80@item @var{X} @tab The type shall be @code{INTEGER(*)} or @code{REAL(*)}@item @var{Y} @tab The type shall be the same type and kind as @var{X}.@end multitable@item @emph{Return value}:The return value is of type @code{INTEGER(*)} or @code{REAL(*)}.@item @emph{Example}:@smallexampleprogram test_dim    integer :: i    real(8) :: x    i = dim(4, 15)    x = dim(4.345_8, 2.111_8)    print *, i    print *, xend program test_dim@end smallexample@item @emph{Specific names}:@multitable @columnfractions .24 .24 .24 .24@item Name            @tab Argument          @tab Return type       @tab Option@item @code{IDIM(X,Y)} @tab @code{INTEGER(4) X,Y} @tab @code{INTEGER(4)} @tab gnu@item @code{DDIM(X,Y)} @tab @code{REAL(8) X,Y}  @tab @code{REAL(8)} @tab gnu@end multitable@end table@node DOT_PRODUCT@section @code{DOT_PRODUCT} --- Dot product function@findex @code{DOT_PRODUCT} intrinsic@cindex Dot product@table @asis@item @emph{Description}:@code{DOT_PRODUCT(X,Y)} computes the dot product multiplication of two vectors@var{X} and @var{Y}.  The two vectors may be either numeric or logicaland must be arrays of rank one and of equal size. If the vectors are@code{INTEGER(*)} or @code{REAL(*)}, the result is @code{SUM(X*Y)}. If thevectors are @code{COMPLEX(*)}, the result is @code{SUM(CONJG(X)*Y)}. If the vectors are @code{LOGICAL}, the result is @code{ANY(X.AND.Y)}.@item @emph{Option}:f95@item @emph{Class}:transformational function@item @emph{Syntax}:@code{S = DOT_PRODUCT(X,Y)}@item @emph{Arguments}:@multitable @columnfractions .15 .80@item @var{X} @tab The type shall be numeric or @code{LOGICAL}, rank 1.@item @var{Y} @tab The type shall be numeric or @code{LOGICAL}, rank 1.@end multitable@item @emph{Return value}:If the arguments are numeric, the return value is a scaler of numeric type,@code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.  If the arguments are@code{LOGICAL}, the return value is @code{.TRUE.} or @code{.FALSE.}.@item @emph{Example}:@smallexampleprogram test_dot_prod    integer, dimension(3) :: a, b    a = (/ 1, 2, 3 /)    b = (/ 4, 5, 6 /)    print '(3i3)', a    print *    print '(3i3)', b    print *    print *, dot_product(a,b)end program test_dot_prod@end smallexample@end table@node DPROD@section @code{DPROD} --- Double product function@findex @code{DPROD} intrinsic@cindex Double product@table @asis@item @emph{Description}:@code{DPROD(X,Y)} returns the product @code{X*Y}.@item @emph{Option}:f95, gnu@item @emph{Class}:elemental function@item @emph{Syntax}:@code{D = DPROD(X,Y)}@item @emph{Arguments}:@multitable @columnfractions .15 .80@item @var{X} @tab The type shall be @code{REAL}.@item @var{Y} @tab The type shall be @code{REAL}.@end multitable@item @emph{Return value}:The return value is of type @code{REAL(8)}.@item @emph{Example}:@smallexampleprogram test_dprod    integer :: i    real :: x = 5.2    real :: y = 2.3    real(8) :: d    d = dprod(x,y)    print *, dend program test_dprod@end smallexample@end table@node DREAL@section @code{DREAL} --- Double real part function@findex @code{DREAL} intrinsic@cindex Double real part@table @asis@item @emph{Description}:@code{DREAL(Z)} returns the real part of complex variable @var{Z}.@item @emph{Option}:gnu@item @emph{Class}:elemental function@item @emph{Syntax}:@code{D = DREAL(Z)}@item @emph{Arguments}:@multitable @columnfractions .15 .80@item @var{Z} @tab The type shall be @code{COMPLEX(8)}.@end multitable@item @emph{Return value}:The return value is of type @code{REAL(8)}.@item @emph{Example}:@smallexampleprogram test_dreal    complex(8) :: z = (1.3_8,7.2_8)    print *, dreal(z)end program test_dreal@end smallexample@end table@node DTIME@section @code{DTIME} --- Execution time subroutine (or function)@findex @code{DTIME} intrinsic@cindex dtime subroutine @table @asis@item @emph{Description}:@code{DTIME(TARRAY, RESULT)} initially returns the number of seconds of runtimesince the start of the process's execution in @var{RESULT}.  @var{TARRAY}returns the user and system components of this time in @code{TARRAY(1)} and@code{TARRAY(2)} respectively. @var{RESULT} is equal to @code{TARRAY(1) +TARRAY(2)}.Subsequent invocations of @code{DTIME} return values accumulated since theprevious invocation.On some systems, the underlying timings are represented using types withsufficiently small limits that overflows (wraparounds) are possible, such as32-bit types. Therefore, the values returned by this intrinsic might be, orbecome, negative, or numerically less than previous values, during a singlerun of the compiled program.If @code{DTIME} is invoked as a function, it can not be invoked as asubroutine, and vice versa.@var{TARRAY} and @var{RESULT} are @code{INTENT(OUT)} and provide the following:@multitable @columnfractions .15 .30 .60@item @tab @code{TARRAY(1)}: @tab User time in seconds.@item @tab @code{TARRAY(2)}: @tab System time in seconds.@item @tab @code{RESULT}: @tab Run time since start in seconds.@end multitable@item @emph{Option}:gnu@item @emph{Class}:subroutine@item @emph{Syntax}:@multitable @columnfractions .80@item @code{CALL DTIME(TARRAY, RESULT)}.@item @code{RESULT = DTIME(TARRAY)}, (not recommended).@end multitable@item @emph{Arguments}:@multitable @columnfractions .15 .80@item @var{TARRAY}@tab The type shall be @code{REAL, DIMENSION(2)}.@item @var{RESULT}@tab The type shall be @code{REAL}.@end multitable@item @emph{Return value}:Elapsed time in seconds since the start of program execution.@item @emph{Example}:@smallexampleprogram test_dtime    integer(8) :: i, j    real, dimension(2) :: tarray    real :: result    call dtime(tarray, result)    print *, result    print *, tarray(1)    print *, tarray(2)       do i=1,100000000    ! Just a delay        j = i * i - i    end do    call dtime(tarray, result)    print *, result    print *, tarray(1)    print *, tarray(2)end program test_dtime@end smallexample@end table@node EOSHIFT@section @code{EOSHIFT} --- End-off shift function@findex @code{EOSHIFT} intrinsic@cindex eoshift intrinsic@table @asis@item @emph{Description}:@code{EOSHIFT(ARRAY, SHIFT[,BOUNDARY, DIM])} performs an end-off shift onelements of @var{ARRAY} along the dimension of @var{DIM}.  If @var{DIM} isomitted it is taken to be @code{1}.  @var{DIM} is a scaler of type@code{INTEGER} in the range of @math{1 /leq DIM /leq n)} where @math{n} is therank of @var{ARRAY}.  If the rank of @var{ARRAY} is one, then all elements of@var{ARRAY} are shifted by @var{SHIFT} places.  If rank is greater than one,then all complete rank one sections of @var{ARRAY} along the given dimension areshifted.  Elements shifted out one end of each rank one section are dropped.  If@var{BOUNDARY} is present then the corresponding value of from @var{BOUNDARY}is copied back in the other end.  If @var{BOUNDARY} is not present then thefollowing are copied in depending on the type of @var{ARRAY}.@multit

⌨️ 快捷键说明

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