+ nml_carry = 0;
+
+ /* A default (non-DTIO) derived type does not itself hold a value to
+ read; only its components do. Recurse into the components on
+ every iteration of the array loop, independently of the repeat
+ count, so that a repeat count parsed while reading one component
+ (e.g. "ta(1:8)%c = 8*'bogus'") gets applied to that component for
+ each addressed array element. */
+
+ if ((nl->type == BT_DERIVED || nl->type == BT_CLASS)
+ && nl->dtio_sub == NULL)
+ {
+ obj_name_len = strlen (nl->var_name) + 1;
+ obj_name = xmalloc (obj_name_len+1);
+ memcpy (obj_name, nl->var_name, obj_name_len-1);
+ memcpy (obj_name + obj_name_len - 1, "%", 2);
+
+ /* If reading a derived type, disable the expanded read warning
+ since a single object can have multiple reads. */
+ dtp->u.p.expanded_read = 0;
+
+ /* Now loop over the components. */
+
+ for (cmp = nl->next;
+ cmp &&
+ !strncmp (cmp->var_name, obj_name, obj_name_len);
+ cmp = cmp->next)
+ {
+ /* Jump over nested derived type by testing if the potential
+ component name contains '%'. */
+ if (strchr (cmp->var_name + obj_name_len, '%'))
+ continue;
+
+ if (!nml_read_obj (dtp, cmp, (index_type)(pdata - nl->mem_pos),
+ pprev_nl, nml_err_msg, nml_err_msg_size,
+ clow, chigh, true))
+ {
+ free (obj_name);
+ return false;
+ }
+
+ if (dtp->u.p.input_complete)
+ {
+ free (obj_name);
+ return true;
+ }
+ }
+
+ free (obj_name);
+ goto incr_idx;
+ }
+