diff options
Diffstat (limited to 'lib/jtty/jtty_source_codec.f90')
| -rw-r--r-- | lib/jtty/jtty_source_codec.f90 | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/jtty/jtty_source_codec.f90 b/lib/jtty/jtty_source_codec.f90 index e73a62ad..0a3f6193 100644 --- a/lib/jtty/jtty_source_codec.f90 +++ b/lib/jtty/jtty_source_codec.f90 @@ -388,18 +388,22 @@ type(jtty_source_atom) function jtty_text5_atom(text) result(atom) if(n.gt.0) atom%text(1:n)=text(1:n) end function jtty_text5_atom -subroutine pack_jtty_atoms(atoms,natoms,frames,nframes,valid) +subroutine pack_jtty_atoms(atoms,natoms,frames,nframes,valid,is_final) type(jtty_source_atom), intent(in) :: atoms(:) integer, intent(in) :: natoms character(len=34), intent(out) :: frames(:) integer, intent(out) :: nframes logical, intent(out) :: valid + integer, intent(in), optional :: is_final !0/1; absent means final (existing behavior) integer :: i + logical :: final_ok frames=''; nframes=0 valid=natoms.ge.1 .and. natoms.le.16 .and. natoms.le.size(atoms) .and. natoms.le.size(frames) if(.not.valid) return + final_ok=.true. + if(present(is_final)) final_ok=is_final.ne.0 do i=1,natoms - call pack_jtty_atom(atoms(i),frames(i),i.eq.natoms,valid) + call pack_jtty_atom(atoms(i),frames(i),i.eq.natoms .and. final_ok,valid) if(.not.valid) then; frames=''; return; endif enddo nframes=natoms |
