Opened 9 years ago
Closed 9 years ago
#455 closed defect (fixed)
Bug in ropp_io_vlist_size.f90
Reported by: | Ian Culverwell | Owned by: | Ian Culverwell |
---|---|---|---|
Priority: | normal | Milestone: | 9.0 |
Component: | ropp_io | Version: | 8.0 |
Keywords: | vlists | Cc: |
Description
ropp_io/ropp/ropp_io_vlist_size.f90, the overloading of the fortran intrinsic SIZE function for the various (sub-) types of vlists, contains a bug:
FUNCTION size_vlist(vlist) RESULT(n), ... nn(1) = size_vlistD0d(vlist%VlistD0d) nn(2) = size_vlistD1d(vlist%VlistD1d) nn(2) = size_vlistD2d(vlist%VlistD2d) n = SUM(nn)
should of course read
FUNCTION size_vlist(vlist) RESULT(n ... nn(1) = size_vlistD0d(vlist%VlistD0d) nn(2) = size_vlistD1d(vlist%VlistD1d) nn(3) = size_vlistD2d(vlist%VlistD2d) n = SUM(nn)
Attachments (1)
Note:
See TracTickets
for help on using tickets.
According to the word of
SIZE(vlist) is never used by itself: ROPP only calls SIZE(vlist%VlistD0d) etc. So fixing this should have no effect. (Which is also why getting it wrong all these years didn't cause any problems.)
But to confirm, when we run ropp_apps_tph_tool on some (artificial) data with 0, 1, and 2D extra data, we find, at ROPP8.1:
which is obviously wrong, while at ROPP9.0:
which is obviously correct. (But the results are the same, thankfully.)
That's good enough: implementing at r4892.
Testing script also attached.