Skip to content

changed format es24.15 -> es24.15e3 in xml writer.

Riccardo Bertossa requested to merge rikigigi/q-e:develop into develop

in gfortran 12.2.0 the code:

   program pippo
      integer, parameter :: dp = selected_real_kind(15)
      real(dp) :: t(3)
      real(dp) :: m(3,3)

      t=(/ 1.445e-108_dp/23.0_dp, 73.3_dp, 1.2e-87_dp /)
      write( *, '(1p3es24.15)' ) t
      write( *, '(2p3es24.15e3)' ) t
      write( *, '(1pes24.15)') t(1)
      write( *, '(1pes24.15e3)') t(1)

      m=0.0_dp
      m(2,2)=3.456e-200_dp
      m(3,1)=1.234e300_dp
      write(*, '(1p3es24.15)') m
      write(*, '(1p3es24.15e3)') m

   end program pippo

produces the output

   6.282608695652174-110   7.330000000000000E+01   1.200000000000000E-87
  6.282608695652174E-110  7.330000000000000E+001  1.200000000000000E-087
   6.282608695652174-110
  6.282608695652174E-110
   0.000000000000000E+00   0.000000000000000E+00   1.234000000000000+300
   0.000000000000000E+00   3.456000000000000-200   0.000000000000000E+00
   0.000000000000000E+00   0.000000000000000E+00   0.000000000000000E+00
  0.000000000000000E+000  0.000000000000000E+000  1.234000000000000E+300
  0.000000000000000E+000  3.456000000000000E-200  0.000000000000000E+000
  0.000000000000000E+000  0.000000000000000E+000  0.000000000000000E+000

please note that the 'E' is missing in the tinier double precision floating point numbers this was causing error in the parsing of the XML

Edited by Riccardo Bertossa

Merge request reports