anchor.diff:           endif
         endif
         
  -      write (*,*) 'Read header, record=', n
  +      write (ounit,*) 'Read header, record=', n
         ntwin=1
         if(ilapa.ne.ifipa) ntwin=2
  -      write (*,*) 'Header ntwin ',ntwin,ifipa,ilapa
  +      write (ounit,*) 'Header ntwin ',ntwin,ifipa,ilapa
         ! ifipa=0
         n=n+1 !Increase record number
  -      write(*,*) sixtit
  -      write(*,*) commen
  -      write (*,*) progrm,itopa,icode,numl
  +      write(ounit,*) sixtit
  +      write(ounit,*) commen
  +      write (ounit,*) progrm,itopa,icode,numl
         errno=dtostr(qwc(1),ch1)
  -      write(*,*) ch1
  +      write(ounit,*) ch1
         errno=dtostr(qwc(2),ch1)
  -      write(*,*) ch1
  +      write(ounit,*) ch1
         errno=dtostr(qwc(3),ch1)
  -      write(*,*) ch1
  +      write(ounit,*) ch1
         errno=dtostr(clo(1),ch1)
  -      write(*,*) ch1
  +      write(ounit,*) ch1
         errno=dtostr(clop(1),ch1)
  -      write(*,*) ch1
  +      write(ounit,*) ch1
         errno=dtostr(clo(2),ch1)
  -      write(*,*) ch1
  +      write(ounit,*) ch1
         errno=dtostr(clop(2),ch1)
  -      write(*,*) ch1
  +      write(ounit,*) ch1
         errno=dtostr(clo(3),ch1)
  -      write(*,*) ch1
  +      write(ounit,*) ch1
         errno=dtostr(clop(3),ch1)
  -      write(*,*) ch1
  +      write(ounit,*) ch1
         errno=dtostr(di0(1),ch1)
  -      write(*,*) ch1
  +      write(ounit,*) ch1
         errno=dtostr(dip0(1),ch1)
  -      write(*,*) ch1
  +      write(ounit,*) ch1
         errno=dtostr(di0(2),ch1)
  -      write(*,*) ch1
  +      write(ounit,*) ch1
         errno=dtostr(dip0(2),ch1)
  -      write(*,*) ch1
  +      write(ounit,*) ch1
         do i=1,6
           do j=1,6
             errno=dtostr(ta(i,j),ch1)
  -          write (*,*) ch1
  +          write (ounit,*) ch1
           enddo
         enddo
         errno=dtostr(dmmac,ch1)
  -      write(*,*) ch1
  +      write(ounit,*) ch1
         errno=dtostr(dnms,ch1)
  -      write(*,*) ch1
  +      write(ounit,*) ch1
         errno=dtostr(dizu0,ch1)
  -      write(*,*) ch1
  +      write(ounit,*) ch1
         errno=dtostr(dnumlr,ch1)
  -      write(*,*) ch1
  +      write(ounit,*) ch1
         errno=dtostr(sigcor,ch1)
  -      write(*,*) ch1
  +      write(ounit,*) ch1
         errno=dtostr(dpscor,ch1)
  -      write(*,*) ch1
  +      write(ounit,*) ch1
   
         if (STF) then
            if (ifipa .lt. itopa-1) goto 100 !Read more headers
  
positive.code: 
                 fname=cmdarg_arg
                 
              else
                 write(*,*) "USAGE: read90 (--STF) (--SP <number> | --PR <number> <number>) (--fname <name>)"
                 write(*,*) "The --STF flag indicates that the file is in the new STF format"
                 write(*,*) "The --SP and --PR flag can only be used together with the --STF flag,"
                 write(*,*) " in order to extract only single particle (pair) data in a way that emulates the old format."
  
negative.code:       
    212 continue
  ! Do conversion and print, add text later?
        write (ounit,*) 'Read record ',n
        write (ounit,*) 'Turn ',ia,'   Particle ',ifipa
        errno=dtostr(b,ch1)
        write(ounit,*) ch1
        errno=dtostr(c,ch1)
        write(ounit,*) ch1
        errno=dtostr(d,ch1)
        write(ounit,*) ch1
        errno=dtostr(e,ch1)
        write(ounit,*) ch1
        errno=dtostr(f,ch1)
        write(ounit,*) ch1
        errno=dtostr(g,ch1)
        write(ounit,*) ch1
        errno=dtostr(h,ch1)
        write(ounit,*) ch1
        errno=dtostr(p,ch1)
        write(ounit,*) ch1
        if(ntwin.eq.2) then
          write (ounit,*) 'Turn ',ia,'   Particle ',ilapa
          errno=dtostr(b,ch1)
          write(ounit,*) ch1
          errno=dtostr(c1,ch1)
          write(ounit,*) ch1
          errno=dtostr(d1,ch1)
          write(ounit,*) ch1
          errno=dtostr(e1,ch1)
          write(ounit,*) ch1
          errno=dtostr(f1,ch1)
          write(ounit,*) ch1
          errno=dtostr(g1,ch1)
          write(ounit,*) ch1
          errno=dtostr(h1,ch1)
          write(ounit,*) ch1
          errno=dtostr(p1,ch1)
          write(ounit,*) ch1
        endif
        goto 211
    510 continue
        write(ounit,*) nfile,'FILE CORRUPTED record',n
        goto 550
    511 continue
        write(ounit,*) nfile,'NO HEADER, EMPTY FILE!!!'
        goto 550
    520 continue
        write(ounit,*) nfile,'HEADER CORRUPTED'
        goto 550
    530 continue
        write(ounit,*) nfile,'NO DATA'
        goto 550
    540 continue
    550 continue
  