Skip to content

Commit fecd7b2

Browse files
authored
Merge pull request #117 from m3g/use_while
adjust loops for reading radius
2 parents d87ecd4 + 8540d3c commit fecd7b2

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ packmol changelog
1212

1313
Version 21.2.1-DEV
1414
--------------
15+
- ![INFO][badge-info] Avoid looping above `maxkeywords` in input file reading of radii.
1516

1617
Version 21.2.0
1718
--------------

app/packmol.f90

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,7 @@ program packmol
417417
stop exit_code_input_error
418418
end if
419419
ival = 2
420-
do
421-
if (ival > maxkeywords) exit
420+
do while(ival <= maxkeywords)
422421
read(keyword(iline_atoms,ival),*,iostat=ioerr) iat
423422
if ( ioerr /= 0 ) exit
424423
if ( iat > natoms(itype) ) then
@@ -440,8 +439,7 @@ program packmol
440439
stop exit_code_input_error
441440
end if
442441
ival = 2
443-
do
444-
if (ival > maxkeywords) exit
442+
do while(ival <= maxkeywords)
445443
read(keyword(iline_atoms,ival),*,iostat=ioerr) iat
446444
if ( ioerr /= 0 ) exit
447445
if ( iat > natoms(itype) ) then
@@ -463,8 +461,7 @@ program packmol
463461
stop exit_code_input_error
464462
end if
465463
ival = 2
466-
do
467-
if (ival > maxkeywords) exit
464+
do while(ival <= maxkeywords)
468465
read(keyword(iline_atoms,ival),*,iostat=ioerr) iat
469466
if ( ioerr /= 0 ) exit
470467
if ( iat > natoms(itype) ) then
@@ -487,8 +484,7 @@ program packmol
487484
stop exit_code_input_error
488485
end if
489486
ival = 2
490-
do
491-
if (ival > maxkeywords) exit
487+
do while(ival <= maxkeywords)
492488
read(keyword(iline_atoms,ival),*,iostat=ioerr) iat
493489
if ( ioerr /= 0 ) exit
494490
if ( iat > natoms(itype) ) then

0 commit comments

Comments
 (0)