Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28592 Discussions

Simple Question regarding Intrinsic Procedures

seniorrojo
Beginner
397 Views
Hello,

I think I have a very simple question. I am trying to use a few intrinsic procedures in my
program (such as sin, cos, abs, etc.) and am wondering how to tell the compiler to include
these functions in my program?

So, for example, if I wanted to use the ABS function (Class: Elemental function; Generic) how
do I include this in my program?

Thanks in advance.
0 Kudos
3 Replies
TimP
Honored Contributor III
397 Views
Quoting - seniorrojo

I am trying to use a few intrinsic procedures in my
program (such as sin, cos, abs, etc.) and am wondering how to tell the compiler to include
these functions in my program?

So, for example, if I wanted to use the ABS function (Class: Elemental function; Generic) how
do I include this in my program?

The standard Fortran 95 intrinsics are all available by default, as long as you don't redefine them into something else. Some of the new f2003 functions require corresponding USE declarations, as described in your textbook.
0 Kudos
Steven_L_Intel1
Employee
397 Views
To expand on Tim's reply - if the procedure is listed as an "intrinsic procedure", it's built in to the compiler and you need not do anything special to use it. Fortran also has "intrinsic modules", some of which contain procedures. These are documented separately (and actually, at this time, aren't documented at all in the Intel manuals - you'd have to read the F2003 standard for those.)
0 Kudos
seniorrojo
Beginner
397 Views
To expand on Tim's reply - if the procedure is listed as an "intrinsic procedure", it's built in to the compiler and you need not do anything special to use it. Fortran also has "intrinsic modules", some of which contain procedures. These are documented separately (and actually, at this time, aren't documented at all in the Intel manuals - you'd have to read the F2003 standard for those.)


Hi Tim and Steve,

Thank you for your responses. In my haste to try a simple function in Fortran, I forgot
to assign it to a value. So instead of typing x=sin(3.14), I was simply typing sin(3.14) and
was receiving an error message. Sometimes it pays not to think in "Matlab" :-)

Thanks again for your assistance!
0 Kudos
Reply