https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82086
Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |jvdelisle at gcc dot gnu.org CC| |jvdelisle at gcc dot gnu.org --- Comment #13 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> --- I took a little dive into this and I see what is happening. We call nml_read_obj recursively. The inital call is with the derived type as an array and the rank and dimensions are correct and the repeat count set properly. Then, when we go to read the component which is a scalar by itself we do another nml_read_obj but this time there is no loop spec to iterate over so we pass through that code and hit the error message. To fix this I think we need to save the repeat count and pass it down into the nml_read_object. At the moment it is a global saved in the dtp structure.