Skip to content

Commit 994cfd1

Browse files
author
Steve Goldhaber
committed
Fix indexing for partial rows
1 parent 49ef94e commit 994cfd1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tools/cmip_namelists/extract_master_list.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ def parse_diagnostic_fieldnames(logfile, save_names=False):
6767
num_fields = len(all_fieldnames)
6868
while fieldnum < num_fields:
6969
line = ""
70-
for index in range(num_on_line):
71-
fieldname = all_fieldnames[fieldnum + index]
70+
for index in range(fieldnum, min(fieldnum + num_on_line, num_fields)):
71+
fieldname = all_fieldnames[index]
7272
pad = " "*(maxlen + 2 - len(fieldname))
7373
line += f"{fieldname}{pad}"
7474
# end for

0 commit comments

Comments
 (0)