Hi all,

I have encountered this error ("forrtl: error (65): floating invalid") when running a code in which I have defined a kind for real and integers number, through the intrinsic function selected_int/real_kind. I have put these two parameter in a module named "kinds".

When the code computes a mathematical operation, in particular calculates an exponential of a real number, it aborts the execution with that error message. I use the 64bit version of the ifort compiler (composer_xe_2013.1.117) and the following command for compiling:

ifort -g -check all -fpe0 -warn -traceback -debug extended *.f kind.f90 constants.f90 groupv_weighted_k.f90 -o Groupv.x

Obviously, if I set the option "-fpe" to an higher level (the default 3, for example), the error disappears but the output results are "NaN".

Here the lines where the error occurs and the variables declaration section:

use kinds, only: dp, i4b use constants, only: pi, tpi, H_PLANCK_SI, K_BOLTZMANN_SI, BOHR_RADIUS_SI, & K_BOLTZMANN_AU, K_BOLTZMANN_RY, eV_to_kelvin, ry_to_kelvin, & RY_TO_THZ, RY_TO_CMM1, C_SI implicit none integer(kind=i4b) :: n, nband, nq, i, j, k, m, l, nks, info, ntemp, nstep=5, nkp, ndisp integer, parameter :: cart=3 real(dp), parameter :: a=4.2499983433897e0_dp,& ! lattice constant in Angstrom vcell=1823.0452e0_dp,& ! primitive cell volume in AU CMM1_TO_THZ= 1.0e-10_dp*C_SI real(dp) :: qlsum, csum, temp(27), T, vcellq, f1, f2, omega, ktemp(3), Tstep, Tstart, Tend real(dp), allocatable :: der(:,:,:), qvec3d(:,:,:), omega3d(:,:,:), delta(:,:), gv(:,:),& norma(:), avcgv(:), specheat(:), wk(:), Ttemp(:) character(100) :: buffer, infile character(12) :: dummy_c character(6) :: dummy_c2 [...] qlsum = qlsum + ( gv(i,j)*(omega3d(i,j,0))**2.e0_dp*Exp(f2*omega3d(i,j,0)/T) / & ( (Exp(f2*omega3d(i,j,0)/T)-1)**2.e0_dp*(T**2.e0_dp) ) )*wk(i)

Thanks,

Edoardo