[Wien] gfortran compilation and run problems for 19.1

Gavin Abo gsabo at crimson.ua.edu
Wed Jun 26 09:32:38 CEST 2019


Interesting, it does compile and run with ifort but does not compile 
with gfortran.  The -stand option could be used with ifort so that it 
gives a compiler message similar to gfortran [ 
https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-stand 
]:

username at computername:~/Desktop/test$ cat logicaltest.f
       program logicaltest
        implicit none
!
!     test ==, .eq., .eqv.
!
        logical   a, b, c

        a=.true.
        b=.true.

        if(a == b) then
           write(6,*) 'a == b'
        end if

        if(a .eq. b) then
           write(6,*) 'a .eq. b'
        end if

        if(a .eqv. b) then
           write(6,*) 'a .eqv. b'
        end if

       end

username at computername:~/Desktop/test$ ifort -v
ifort version 19.0.4.243
username at computername:~/Desktop/test$ ifort logicaltest.f -o logicaltest
username at computername:~/Desktop/test$ ./logicaltest
  a == b
  a .eq. b
  a .eqv. b


username at computername:~/Desktop/test$ gfortran --version
GNU Fortran (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

username at computername:~/Desktop/test$ gfortran logicaltest.f -o logicaltest
logicaltest.f:11:10:

         if(a == b) then
           1
Error: Logicals at (1) must be compared with .eqv. instead of ==
logicaltest.f:15:10:

         if(a .eq. b) then
           1
Error: Logicals at (1) must be compared with .eqv. instead of .eq.


username at computername:~/Desktop/test$ ifort logicaltest.f -o logicaltest 
-stand
logicaltest.f(1): warning #7373: Fixed form source is an obsolescent 
feature in Fortran 2008.
       program logicaltest
^
logicaltest.f(11): warning #6297: Fortran 2008 does not allow a LOGICAL 
data type in this context.   [A]
        if(a == b) then
----------^
logicaltest.f(11): warning #6297: Fortran 2008 does not allow a LOGICAL 
data type in this context.   [B]
        if(a == b) then
---------------^
logicaltest.f(15): warning #6297: Fortran 2008 does not allow a LOGICAL 
data type in this context.   [A]
        if(a .eq. b) then
----------^
logicaltest.f(15): warning #6297: Fortran 2008 does not allow a LOGICAL 
data type in this context.   [B]
        if(a .eq. b) then
-----------------^


On 6/25/2019 11:42 PM, Fecher, Gerhard wrote:
> Dear Gavin,
> Sorry my question was probably to short, it should read
>       Does anyone know whether "== " works with gfortran ?
>
> With ifort the following test works well, but I cannot test it with gfortran
> The answer in the Intel forum that you quote does not include "=="
>
>       program logicaltest
>        implicit none
> !
> !     test ==, .eq., .eqv.
> !
>        logical   a, b, c
>
>        a=.true.
>        b=.true.
>
>        if(a == b) then
>           write(6,*) 'a = b'
>        end if
>
>        if(a .eq. b) then
>           write(6,*) 'a .eq. b'
>        end if
>
>        if(a .eqv. b) then
>           write(6,*) 'a .eqv. b'
>        end if
>        
>        end
>
>
> Ciao
> Gerhard
>
> DEEP THOUGHT in D. Adams; Hitchhikers Guide to the Galaxy:
> "I think the problem, to be quite honest with you,
> is that you have never actually known what the question is."
>
> ====================================
> Dr. Gerhard H. Fecher
> Institut of Inorganic and Analytical Chemistry
> Johannes Gutenberg - University
> 55099 Mainz
> and
> Max Planck Institute for Chemical Physics of Solids
> 01187 Dresden
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://zeus.theochem.tuwien.ac.at/pipermail/wien/attachments/20190626/e1a2cd26/attachment.html>


More information about the Wien mailing list