c c number animals consecutively, according to pedigrees c parameter(nam=50000,ntr=6) character*15 cow,aid(nam),herd,blnk integer kow,year,seas,bdate,cdate,tdate,dd(nam) integer aim,iy(ntr) open(9,file='Ped04S.d',form='formatted',status='old') open(10,file='REP03.d',form='formatted',status='old') open(15,file='REP04.d',form='formatted',status='unknown') open(30,file='red04.out',form='formatted',status='unknown') c nin=0 nout = 0 nmis=0 mam=0 dd=0 blnk= ' ' aid = ' ' 5 read(9,9001,end=9)iam,ias,iad,bi,fi,cow 9001 format(1x,3i10,1x,f20.12,2x,f20.12,2x,a15) mam = mam+1 aid(mam)=cow dd(mam)=iam go to 5 9 close(9) write(30,3302)mam 3302 format(1x,i10,' Pedigrees') 10 read(10,1502,end=50)cow,bdate,kpar,herd,cdate,jyr,jcg,img, x iy 1502 format(1x,a15,i10,i5,a15,i10,i5,i10,i5,6i8) nin = nin + 1 kam=luchs(cow,aid,mam) misc = 0 if(kpar.eq.1)iy(2)=0 if(kpar.gt.1)iy(1)=0 if(iy(1).gt.0)misc = misc + 32 if(iy(2).gt.0)misc = misc + 16 if(iy(3).gt.0)misc = misc + 8 if(iy(4).gt.0)misc = misc + 4 if(iy(5).gt.0)misc = misc + 2 if(iy(6).gt.0)misc = misc + 1 if(misc.gt.47)go to 10 c print *,kam if(kam.gt.0)then aim = dd(kam) write(15,1503)cow,aim,bdate,kpar,herd,cdate,jyr,jcg,img, x misc,iy 1503 format(1x,a15,2i10,i5,a15,i10,i5,i10,2i5,6i8) nout = nout + 1 else aim=0 nmis = nmis + 1 write(30,1505)cow 1505 format(1x,a15,',') endif go to 10 50 close(10) close(15) write(30,3033)nin,nout,nmis,mam 3033 format(1x,i10,' records in'/1x,i10,' out'/1x, x i10,' not in pedigree'/1x,i10,' Pedigrees In') close(30) stop end include 'lupch.f'