andreww / fox

A Fortran XML library
https://andreww.github.io/fox/
Other
59 stars 50 forks source link

Cray compiler warnings #22

Open andreww opened 11 years ago

andreww commented 11 years ago

Elena Breitmoser reports warnings with the Cray Fortran 8.0.4 compiler with FoX 4.1.2:

     s2(m:) = s(s_i:k)

ftn-7212 crayftn: WARNING SCALARTOSTRING, File = fox_m_fsys_parse_input.F90, Line = 92 Variable "m" is used before it is defined.

     s2(m:) = s(s_i:k)

ftn-7212 crayftn: WARNING ARRAYTOSTRING, File = fox_m_fsys_parse_input.F90, Line = 802 Variable "m" is used before it is defined.

     s2(m:) = s(s_i:k)

ftn-7212 crayftn: WARNING MATRIXTOSTRING, File = fox_m_fsys_parse_input.F90, Line = 955 Variable "m" is used before it is defined.

     s2(m:) = s(s_i:k)

ftn-7212 crayftn: WARNING COUNTSTRING, File = fox_m_fsys_count_parse_input.F90, Line = 74 Variable "m" is used before it is defined.

subroutine cmlAddParticlessp_sh(xf, natoms, elements, atomRefs, coords, occupancies, atomIds, style, fmt) ftn-7212 crayftn: WARNING CMLADDPARTICLESSP_SH, File = m_wcml_molecule.F90, Line = 553 Variable "natoms" is used before it is defined.

subroutine cmlAddParticles_3_sp_sh(xf, natoms, elements, x, y, z, atomRefs, occupancies, atomIds, style, fmt) ftn-7212 crayftn: WARNING CMLADDPARTICLES_3_SP_SH, File = m_wcml_molecule.F90, Line = 642 Variable "natoms" is used before it is defined.

subroutine cmlAddParticlesdp_sh(xf, natoms, elements, atomRefs, coords, occupancies, atomIds, style, fmt) ftn-7212 crayftn: WARNING CMLADDPARTICLESDP_SH, File = m_wcml_molecule.F90, Line = 1270 Variable "natoms" is used before it is defined.

subroutine cmlAddParticles_3_dp_sh(xf, natoms, elements, x, y, z, atomRefs, occupancies, atomIds, style, fmt) ftn-7212 crayftn: WARNING CMLADDPARTICLES_3_DP_SH, File = m_wcml_molecule.F90, Line = 1359

Check and debug if needed.

andreww commented 11 years ago

The warnings in m_wcml_molecule.F90 look bogus - natoms is an intent(in) dummy argument so it must be defined in these four places. Also, gfortran does not give the same warning with -Wall (it does for m in fox_m_fsys_parse_input).

Gfortran does produce some other warnings (unused arguments in the new inputdec stuff) which are real bugs which are now fixed.