This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Warning: Non-zero imaginary part discarded in conversion from 'COMPLEX(8)' to 'REAL(8)'


I get this warning (FreeBSD 11-current amd64):

gfortran6 -c -O -Wall -g -fsign-zero mterm.f90
mterm.f90:10:4:

 use fun
    1
Warning: Non-zero imaginary part discarded in conversion from 'COMPLEX(8)' to 'REAL(8)' at (1) [-Wconversion]

I'm not sure what object the warning refers to.

>From mterm.f90:

      9 module mterm
     10 use fun
     11 implicit none
     12
     13 complex( kind=fk ) :: z
     14 character( len=80 ) :: fmt
     15

Lines 1-8 are comments and blank lines.

This is the beginning of module fun.f90:

      8 module fun
      9 use iso_fortran_env
     10 implicit none
     11 private
     12 public :: fk, pi, eps, hugefk, tinyfk, one, half, zerop,    &
     13  zerom, cmplxj, zinv, strip1, epp
     14 !, crab
     15
     16 integer, parameter :: fk = real64
     17 real( kind=fk ), parameter :: one = 1.0_fk, half = 0.5_fk,  &
     18   pi = 3.14159265358979323846264338327950288419_fk,         &
     19   eps = epsilon( one ), hugefk = huge( one ),               &
     20   tinyfk = tiny( one ), zerop = 0.0_fk, zerom = -0.0_fk
     21 complex( kind=fk ), parameter :: cmplxj = ( 0, 1 )

lines 1-7 are comments and blanks.

Again, I'm trying to understand which object the warning refers to.

Thanks

Anton


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]