diff --git a/lib/decoder.f90 b/lib/decoder.f90 index 59f80b4c0..0b12d020d 100644 --- a/lib/decoder.f90 +++ b/lib/decoder.f90 @@ -687,12 +687,14 @@ contains write(*,1001) params%nutc,snr,dt,nint(freq),decoded0,annot 1001 format(i6.6,i4,f5.1,i5,' + ',1x,a37,1x,a2) - if(ios13.eq.0) write(13,1002) params%nutc,nint(sync),snr,dt, & - freq,0,decoded0 -1002 format(i6.6,i4,i5,f6.1,f8.0,i4,3x,a37,' FT4') + + if(ios13.eq.0) then + write(13,1002,err=10) params%nutc,nint(sync),snr,dt,freq,0,decoded0 +1002 format(i6.6,i4,i5,f6.1,f8.0,i4,3x,a37,' FT4') + flush(13) + endif - call flush(6) - if(ios13.eq.0) call flush(13) +10 call flush(6) select type(this) type is (counting_ft4_decoder)