c234567
      program sum
      open(22,file='g1s.1sn')
      open(23,file='g1s.1sp')
 
      open(32,file='g1s.1pn')
      open(33,file='g1s.1pp')

      open(50,file='g1sp.dat')
      open(51,file='g1sn.dat')

      do 1000 i=1,1000
      read(22,*,end=1000)tpf,cnuns
      read(23,*)tpf,cnups
      read(32,*)tpf,cnunp
      read(33,*)tpf,cnupp

      cnup=cnups+cnupp
      cnun=cnuns+cnunp

      write(50,'(6e13.5)')tpf,cnup
      write(51,'(6e13.5)')tpf,cnun

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