Intel® Fortran Compiler for Linux* and Mac OS X*

AND or OR condition

Hi,

I am trying to find out if using an AND instead of an OR condition is more efficient.

Say I have a check

if(.NOT. (a > 0 and a < 10 and b > 0 and b < 10))then
  call add
else
  call subtract
end if

Is this better than

if(a<0 or a > 10 or b < 0 or b > 10) then
  call add
else
 call subtract
endif

For an AND condition, it is enough if one of the condition is FALSE, whereas for the OR it has to check all the conditions. Is this correct?

is CRITICAL supported in 12.0 or 12.1?

I cannot update from 12.0 and 12.1.

I have a coarray program that uses CRITICAL.

I get:

ifort -c -coarray -free -fPIC -warn all  cgca_m2stat.f90
cgca_m2stat.f90(107): remark #7712: This variable has not been used.   [CG_$1_mtx]
critical
^

At runtime the program seems to hang at CRITICAL, but not always. With 8 or 27 images it seems to work, and with 64 images it hangs.

Please advise

Thanks

Anton

"do i = 1, huge(i); end do" results in infinite loop

Dear all,

The following program seems to goes into an infinite loop.
Is this an expected behavior?

program infinite_loop
  implicit none

  Integer:: i

  do i = 1, huge(i)
  end do

  stop
end program infinite_loop

$ ifort -v
ifort version 13.0.0
$ ifort infinite_loop.F90
$ ./a.out
#=> Get 100% use of CPU and never (at least 5 minutes...) finish.

Sincerely,
Amato

Allocating an allocatable array in an assignment sentence produces unexpeted results or segfaults

Dear forum and Intel developers,

Consider the following code:

program hello
    implicit none
    real(kind=8), allocatable, dimension(:) :: x,y
    x=reshape((/1,2,3,4,5,6/),(/6/))
    print *,x
end program

It will produce blank output. The rememdy is to explicitly allocate x before the reshape statement.

Now the following:

Specifying the working directory as the default for READ and WRITE statements using XCODE4

I have an application with an OPEN statement specifying a static filename for program input data accessed with READ statements (i.e., FILE = 'MY.in') and the same situation for program output via WRITE statements (i.e., FILE = 'MY.out').  I would like the ability for the user to store the input files in a working directory they create to meet their needs before program execution and the output files produced in the working directory during program execution.

A Fortran limerick

Frances Roth, from Intel, wrote a Fortran-themed limerick for an internal contest. She didn't win, but I thought her entry was great and she graciously allowed me to share it:

There Once Was A Woman From Intel
Knew MIC Architecture Was So Swell
She Programmed All Day
In Fortran! Hurray!
So Phi To That OpenCL

Derived-type procedure pointer not able to point to subroutine with extended type as argument

Hi,

The following code compiles and works under the GNU fortran compiler. On the Intel compiler I get: 

error #8178: The procedure pointer and the procedure target must have matching arguments.
mytype%point1 => type2subroutine

Here is the code:

module mod_type1
implicit none

type :: type1
procedure(type1interface), pointer :: point1
end type

interface
subroutine type1interface(a)
import type1
implicit none
class(type1) :: a

end subroutine
end interface

Páginas

Suscribirse a Intel® Fortran Compiler for Linux* and Mac OS X*