c c trim pedigrees down to unique animals c parameter(nam=6000000) character*12 ia,is,id,sire,dam,anim character*12 prev,blnk character*3 isex,ksex integer bdate,adate c c read in Ped00S.d c blnk=' ' prev=blnk mam=0 open(10,file='Ped00S.d',form='formatted',status='old') open(15,file='Ped01.d',form='formatted',status='unknown') read(10,1505,end=50)ia,bdate,isex,is,id anim=ia adate=bdate sire=is dam=id ksex=isex prev = ia c 10 read(10,1505,end=50)ia,bdate,isex,is,id 1505 format(1x,a12,1x,i9,a3,1x,a12,1x,a12) if(ia.ne.prev)then write(15,1505)anim,adate,ksex,sire,dam mam = mam + 1 anim = ia sire = is dam = id adate = bdate ksex = isex prev = ia else if(is.ne.blnk)sire=is if(id.ne.blnk)dam=id endif go to 10 c c -r 1 13 14 23 26 27 39 40 52 c -r53 -ka2a12a28a12 c 50 write(15,1505)anim,adate,ksex,sire,dam mam = mam + 1 print *,mam,' Unique animals out' close(15) close(10) stop end