c234567
      program sum
      open(20,file='2int.asn')
      open(21,file='2int.asp')
      open(22,file='2int.1sn')
      open(23,file='2int.1sp')
 
      open(30,file='2int.apn')
      open(31,file='2int.app')
      open(32,file='2int.1pn')
      open(33,file='2int.1pp')

      open(50,file='nup.dat')
      open(51,file='nun.dat')
      open(52,file='anun.dat')
      open(53,file='anup.dat')

      do 1000 i=1,1000
      read(20,*,end=1000)tpf,anuns
      read(21,*)tpf,anups
      read(22,*)tpf,cnuns
      read(23,*)tpf,cnups
      read(30,*)tpf,anunp
      read(31,*)tpf,anupp
      read(32,*)tpf,cnunp
      read(33,*)tpf,cnupp

      cnup=cnups+cnupp
      cnun=cnuns+cnunp
      anup=anups+anupp
      anun=anuns+anunp

      write(50,'(6e13.5)')tpf,cnup
      write(51,'(6e13.5)')tpf,cnun
      write(52,'(6e13.5)')tpf,anun
      write(53,'(6e13.5)')tpf,anup

      write(*,'(6e13.5)')tpf,cnup/cnun,anup/anun
1000  continue
      end
