MASS Fortran interfaces for Blue Gene

Product documentation


Abstract

This document provides Fortran interface blocks for the MASS scalar, SIMD, and vector functions.

Content

MASS Fortran interfaces for Blue Gene/Q

For information on the MASS Fortran interfaces for Blue Gene®/Q, click on the following links:
Using the scalar library
Using the SIMD library
Using the vector library

MASS Fortran interfaces for Blue Gene/L and Blue Gene/P

c************************************************************
c* Fortran interfaces for the scalar MASS functions.        *
c* Interfaces for functions which are not intrinsics are    *

c* available in mass.include.                               *
c************************************************************

      interface
c************************************************************
c* Fortran interfaces for the real*4 scalar MASS functions. *
c************************************************************      

      real*4 function acosf (%val(x))
        real*4 x
c       Returns the arccosine of x
      end function acosf
      real*4 function acoshf (%val(x))
        real*4 x
c       Returns the hyperbolic arccosine of x
      end function acoshf
      real*4 function anint (%val(x))
        real*4 x
c       Returns the rounded integer value of x
      end function anint
      real*4 function asinf (%val(x))
        real*4 x
c       Returns the arcsine of x
      end function asinf
      real*4 function asinhf (%val(x))
        real*4 x
c       Returns the hyperbolic arcsine of x
      end function asinhf
      real*4 function atanf (%val(x))
        real*4 x
c       Returns the arctangent of x
      end function atanf
      real*4 function atanhf (%val(x))
        real*4 x
c       Returns the hyperbolic arctangent of x
      end function atanhf
      real*4 function cbrtf (%val(x))
        real*4 x
c       Returns the cube root of x
      end function cbrtf
      real*4 function cosf (%val(x))
        real*4 x
c       Returns the cosine of x
      end function cosf
      real*4 function coshf (%val(x))
        real*4 x
c       Returns the hyperbolic cosine of x
      end function coshf
      real*4 function erfcf (%val(x))
        real*4 x
c       Returns the complementary error function of x
      end function erfcf
      real*4 function erff (%val(x))
        real*4 x
c       Returns the error function of x
      end function erff
      real*4 function expf (%val(x))
        real*4 x
c       Returns the exponential function of x
      end function expf
      real*4 function expm1f (%val(x))
        real*4 x
c       Returns (the exponential function of x) - 1
      end function expm1f
      real*4 function lgammaf (%val(x))
        real*4 x
c       Returns the natural logarithm of the absolute value of the
c       Gamma function of x
      end function lgammaf
      real*4 function log10f (%val(x))
        real*4 x
c       Returns the base 10 logarithm of x
      end function log10f
      real*4 function log1pf (%val(x))
        real*4 x
c       Returns the natural logarithm of (x+1)
      end function log1pf
      real*4 function logf (%val(x))
        real*4 x
c       Returns the natural logarithm of x
      end function logf
      real*4 function sinf (%val(x))
        real*4 x
c       Returns the sine of x
      end function sinf
      real*4 function sinhf (%val(x))
        real*4 x
c       Returns the hyperbolic sine of x
      end function sinhf
      real*4 function tanf (%val(x))
        real*4 x
c       Returns the tangent of x
      end function tanf
      real*4 function tanhf (%val(x))
        real*4 x
c       Return the hyperbolic tangent of x
      end function tanhf
      real*4 function atan2f (%val(x),%val(y))
        real*4 x
c       Returns the arctangent of x/y
      end function atan2f
      real*4 function copysignf (%val(x),%val(y))
        real*4 x,y
c       Returns x with the sign of y
      end function copysignf
      real*4 function hypotf (%val(x),%val(y))
        real*4 x,y
c       Returns the square root of x squared + y squared
      end function hypotf
      real*4 function powf (%val(x),%val(y))
        real*4 x,y
c       Returns x raised to the power of y
      end function powf

c************************************************************
c* Fortran interfaces for the real*8 scalar MASS functions. *
c************************************************************
      real*8 function acos (%val(x))
        real*8 x
c       Returns the arccosine of x
      end function acos
      real*8 function acosh (%val(x))
        real*8 x
c       Returns the hyperbolic arccosine of x
      end function acosh
      real*8 function asin (%val(x))
        real*8 x
c       Returns the arcsine of x
      end function asin
      real*8 function asinh (%val(x))
        real*8 x
c       Returns the hyperbolic arcsine of x
      end function asinh
      real*8 function atan (%val(x))
        real*8 x
c       Returns the arctangent of x
      end function atan
      real*8 function atanh (%val(x))
        real*8 x
c       Returns the hyperbolic arctangent of x
      end function atanh
      real*8 function cbrt (%val(x))
        real*8 x
c       Returns the cube root of x
      end function cbrt
      real*8 function cos (%val(x))
        real*8 x
c       Returns the cosine of x
      end function cos
      real*8 function cosh (%val(x))
        real*8 x
c       Returns the hyperbolic cosine of x
      end function cosh
      real*8 function erfc (%val(x))
        real*8 x
c       Returns the complementary error function of x
      end function erfc
      real*8 function dnint (%val(x))
        real*8 x
c       Returns the rounded integer value of x
      end function dnint
      real*8 function erf (%val(x))
        real*8 x
c       Returns the error function of x
      end function erf
      real*8 function exp (%val(x))
        real*8 x
c       Returns the exponential function of x
      end function exp
      real*8 function expm1 (%val(x))
        real*8 x
c       Returns (the exponential function of x) - 1
      end function expm1
      real*8 function lgamma (%val(x))
        real*8 x
c       Returns the natural logarithm of the absolute value of the
c       Gamma function of x
      end function lgamma
      real*8 function log10 (%val(x))
        real*8 x
c       Returns the base 10 logarithm of x
      end function log10
      real*8 function log1p (%val(x))
        real*8 x
c       Returns the natural logarithm of (x+1)
      end function log1p
      real*8 function log (%val(x))
        real*8 x
c       Returns the natural logarithm of x
      end function log
      real*8 function sin (%val(x))
        real*8 x
c       Returns the sine of x
      end function sin
      real*8 function sinh (%val(x))
        real*8 x
c       Returns the hyperbolic sine of x
      end function sinh
      real*8 function tan (%val(x))
        real*8 x
c       Returns the tangent of x
      end function tan
      real*8 function tanh (%val(x))
        real*8 x
c       Return the hyperbolic tangent of x
      end function tanh
      subroutine sincos (%val(x), s, c)
        real*8 s, c, x
c       Sets s to the sine of x and c to the cosine of x
      end subroutine sincos
      real*8 function atan2 (%val(x),%val(y))
        real*8 x,y
c       Returns the arctangent of x/y
      end function atan2
      real*8 function copysign (%val(x),%val(y))
        real*8 x,y
c       Returns x with the sign of y
      end function copysign
      real*8 function hypot (%val(x),%val(y))
        real*8 x,y
c       Returns the square root of x squared + y squared
      end function hypot
     

cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c     Fortran interface blocks for MASS vector functions.
c     These interface blocks are also in massv.include.
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c     Fortran interface block for MASS double-precision vector
c     functions.
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
     
     interface
     
     subroutine vacos (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the arccosine of x(i), for i=1,..,n
     end subroutine vacos
     
     subroutine vacosh (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the arc hyperbolic cosine of x(i),
c       for i=1,..,n
     end subroutine vacosh
     
     subroutine vasin(y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the arcsine of x(i), for i=1,..,n
     end subroutine vasin
     
     subroutine vasinh (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the arc hyperbolic sine of x(i), for i=1,..,n
     end subroutine vasinh
     
     subroutine vatan2 (z, x, y, n)
       real*8 z(*), x(*), y(*)
       integer n
c       Sets z(i) to the arctangent of x(i)/y(i), for i=1,..,n
     end subroutine vatan2
     
     subroutine vatanh (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the arc hyperbolic tangent of x(i),
c       for i=1,..,n
     end subroutine vatanh

     subroutine vcbrt (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the cube root of x(i), for i=1,..,n
     end subroutine vcbrt
     
     subroutine vcos (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the cosine of x(i), for i=1,..,n
     end subroutine vcos
     
     subroutine vcosh (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the hyperbolic cosine of x(i), for i=1,..,n
     end subroutine vcosh
     
     subroutine vcosisin (y, x, n)
       complex*16 y(*)
       real*8 x(*)
       integer n
c       Sets the real part of y(i) to the cosine of x(i) and the
c       imaginary part c of y(i) to the sine of x(i), for i=1,..,n
     end subroutine vcosisin
     
     subroutine vdint (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the integer truncation of x(i), for i=1,..,n
     end subroutine vdint
     
     subroutine vdiv (z, x, y, n)
       real*8 z(*), x(*), y(*)
       integer n
c       Sets z(i) to x(i)/y(i), for i=1,..,n
     end subroutine vdiv
     
     subroutine vdnint (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the nearest integer to x(i), for i=1,..,n
     end subroutine vdnint
     
     subroutine vexp (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the exponential function of x(i),
c       for i=1,..,n
     end subroutine vexp
     
     subroutine vexpm1 (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to (the exponential function of x(i))-1,
c       for i=1,..,n
     end subroutine vexpm1
     
     subroutine vlog (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the natural logarithm of x(i), for i=1,..,n
     end subroutine vlog
     
     subroutine vlog10 (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the base-10 logarithm of x(i), for i=1,..,n
     end subroutine vlog10
     
     subroutine vlog1p (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the natural logarithm of (x(i)+1),
c       for i=1,..,n
     end subroutine vlog1p
     
     subroutine vpow (z, x, y, n)
       real*8 z(*), x(*), y(*)
       integer n
c       Sets z(i) to x(i) raised to the power y(i), for i=1,..,n
     end subroutine vpow
     
     subroutine vqdrt (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the 4th root of x(i), for i=1,..,n
     end subroutine vqdrt
     
     subroutine vrcbrt (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the reciprocal of the cube root of x(i),
c       for i=1,..,n
     end subroutine vrcbrt
     
     subroutine vrec (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the reciprocal of x(i), for i=1,..,n
     end subroutine vrec
     
     subroutine vrqdrt (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the reciprocal of the 4th root of x(i),
c       for i=1,..,n
     end subroutine vrqdrt
     
     subroutine vrsqrt (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the reciprocal of the square root of x(i),
c       for i=1,..,n
     end subroutine vrsqrt
     
     subroutine vsin (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the sine of x(i), for i=1,..,n
     end subroutine vsin
     
     subroutine vsincos (y, z, x, n)
       real*8 y(*), z(*), x(*)
       integer n
c       Sets y(i) to the sine of x(i)

        and z(i) to the cosine of x(i), i=1,..,n
     end subroutine vsincos
     
     subroutine vsinh (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the hyperbolic sine of x(i), for i=1,..,n
     end subroutine vsinh
     
     subroutine vsqrt (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the square root of x(i), for i=1,..,n
     end subroutine vsqrt
     
     subroutine vtan (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the tangent of x(i), for i=1,..,n
     end subroutine vtan
     
     subroutine vtanh (y, x, n)
       real*8 y(*), x(*)
       integer n
c       Sets y(i) to the hyperbolic tangent of x(i), for i=1,..,n
     end subroutine vtanh
     
     end interface
     
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c     Fortran interface block for MASS single-precision vector
c     functions.
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
     
     interface
     
     subroutine vsacos (y, x, n)
       real*4 y(*), x(*)
       integer n
c       Sets y(i) to the arccosine of x(i), for i=1,..,n
     end subroutine vsacos
     
     subroutine vsacosh (y, x, n)
       real*4 y(*), x(*)
       integer n
c       Sets y(i) to the arc hyperbolic cosine of x(i),
c       for i=1,..,n
     end subroutine vsacosh
     
     subroutine vsasin(y, x, n)
       real*4 y(*), x(*)
       integer n
c       Sets y(i) to the arcsine of x(i), for i=1,..,n
     end subroutine vsasin
     
     subroutine vsasinh (y, x, n)
       real*4 y(*), x(*)
       integer n
c       Sets y(i) to the arc hyperbolic sine of x(i), for i=1,..,n
     end subroutine vsasinh
     
     subroutine vsatan2 (z, x, y, n)
       real*4 z(*), x(*), y(*)
       integer n
c       Sets z(i) to the arctangent of x(i)/y(i), for i=1,..,n
     end subroutine vsatan2
     
     subroutine vsatanh (y, x, n)
       real*4 y(*), x(*)
       integer n
c       Sets y(i) to the arc hyperbolic tangent of x(i),
c       for i=1,..,n
     end subroutine vsatanh

     subroutine vscbrt (y, x, n)
       real*4 y(*), x(*)
       integer n
c       Sets y(i) to the cube root of x(i), for i=1,..,n
     end subroutine vscbrt
     
     subroutine vscos (y, x, n)
       real*4 y(*), x(*)
       integer n
c       Sets y(i) to the cosine of x(i), for i=1,..,n
     end subroutine vscos
     
     subroutine vscosh (y, x, n)
       real*4 y(*), x(*)
       integer n
c       Sets y(i) to the hyperbolic cosine of x(i), for i=1,..,n
     end subroutine vscosh
     
     subroutine vscosisin (y, x, n)
       complex*16 y(*)
       real*4 x(*)
       integer n
c       Sets the real part of y(i) to the cosine of x(i) and the
c       imaginary part c of y(i) to the sine of x(i), for i=1,..,n
     end subroutine vscosisin
     
     subroutine vsdiv (z, x, y, n)
       real*4 z(*), x(*), y(*)
       integer n
c       Sets z(i) to x(i)/y(i), for i=1,..,n
     end subroutine vsdiv
     
     subroutine vsexp (y, x, n)
       real*4 y(*), x(*)
       integer n
c       Sets y(i) to the exponential function of x(i),
c       for i=1,..,n
     end subroutine vsexp
     
     subroutine vsexpm1 (y, x, n)
       real*4 y(*), x(*)
       integer n
c       Sets y(i) to (the exponential function of x(i))-1,
c       for i=1,..,n
     end subroutine vsexpm1
     
     subroutine vslog (y, x, n)
       real*4 y(*), x(*)
       integer n
c       Sets y(i) to the natural logarithm of x(i), for i=1,..,n
     end subroutine vslog
     
     subroutine vslog10 (y, x, n)
       real*4 y(*), x(*)
       integer n
c       Sets y(i) to the base-10 logarithm of x(i), for i=1,..,n
     end subroutine vslog10
     
     subroutine vslog1p (y, x, n)
       real*4 y(*), x(*)
       integer n
c       Sets y(i) to the natural logarithm of (x(i)+1),
c       for i=1,..,n
     end subroutine vslog1p
     
     subroutine vspow (z, x, y, n)
       real*4 z(*), x(*), y(*)
       integer n
c       Sets z(i) to x(i) raised to the power y(i), for i=1,..,n
     end subroutine vspow
     
     subroutine vsqdrt (y, x, n)
       real*4 y(*), x(*)
       integer n
c       Sets y(i) to the 4th root of x(i), for i=1,..,n
     end subroutine vsqdrt
     
     subroutine vsrcbrt (y, x, n)
       real*4 y(*), x(*)
       integer n
c       Sets y(i) to the reciprocal of the cube root of x(i),
c       for i=1,..,n
     end subroutine vsrcbrt
     
     subroutine vsrec (y, x, n)
       real*4 y(*), x(*)
       integer n
c       Sets y(i) to the reciprocal of x(i), for i=1,..,n
     end subroutine vsrec
     
     subroutine vsrqdrt (y, x, n)
       real*4 y(*), x(*)
       integer n
c       Sets y(i) to the reciprocal of the 4th root of x(i),
c       for i=1,..,n
     end subroutine vsrqdrt
     
     subroutine vsrsqrt (y, x, n)
       real*4 y(*), x(*)
       integer n
c       Sets y(i) to the reciprocal of the square root of x(i),
c       for i=1,..,n
     end subroutine vsrsqrt
     
     subroutine vssin (y, x, n)
       real*4 y(*), x(*)
       integer n
c       Sets y(i) to the sine of x(i), for i=1,..,n
     end subroutine vssin
     
     subroutine vssincos (y, z, x, n)
       real*4 y(*), z(*), x(*)
       integer n
c       Sets y(i) to the sine of x(i) and z(i) to the cosine of x(i),

c       i=1,..,n
     end subroutine vssincos
     
     subroutine vssinh (y, x, n)
       real*4 y(*), x(*)
       integer n
c       Sets y(i) to the hyperbolic sine of x(i), for i=1,..,n
     end subroutine vssinh

     subroutine vssqrt (y, x, n)
       real*4 y(*), x(*)
       integer n
c       Sets y(i) to the square root of x(i), for i=1,..,n
     end subroutine vssqrt
     
     subroutine vstan (y, x, n)
       real*4 y(*), x(*)
       integer n
c       Sets y(i) to the tangent of x(i), for i=1,..,n
     end subroutine vstan
     
     subroutine vstanh (y, x, n)
       real*4 y(*), x(*)
       integer n
c       Sets y(i) to the hyperbolic tangent of x(i), for i=1,..,n
     end subroutine vstanh
     
     end interface


cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c     Fortran interface block for MASS integer vector functions.
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

     interface

     integer*4 function vpopcnt4 (x, n)
       integer*4 x(*), n
c       Returns the total number of 1 bits in the concatenation
c       of the binary representation of x(i), for i=1,...,n.
     end function vpopcnt4

     integer*4 function vpopcnt8 (x, n)
       integer*8 x(*), n
c       Returns the total number of 1 bits in the concatenation
c       of the binary representation of x(i), for i=1,...,n.
     end function vpopcnt8

     end interface


Original publication date

2005/4/7

Rate this page:

(0 users)Average rating

Document information


More support for:

Mathematical Acceleration Subsystem
Libraries

Software version:

4.4, 7.3

Operating system(s):

Linux

Reference #:

7006014

Modified date:

2007-11-11

Translate my page

Machine Translation

Content navigation