c c Read in pedigrees c Input file - assumed sorted (animals within generation number) c in decreasing generation order c Output file - animals are numbered consecutively c c Corrected: Feb 21, 2020 c Counts for Phantom Groups, put in numbers Character*12 ianm,isir,idam,blnk Character*8 bnam(20) Integer phas(50),phad(50) c c Open files c phas=0 phad=0 blnk=' ' open(9,file='PEDA1S.d',form='formatted',status='old') open(10,file='PEDA2.d',form='formatted',status='unknown') open(17,file='ped2.out',form='formatted',status='unknown') c c Initialize arrays c mam=0 c c Read all animals c 10 read(9,1001,end=20)igen,ianm,isir,idam 1001 format(1x,i5,1x,a12,1x,a12,1x,a12) mam=mam+1 kgen=50 - igen if(isir.eq.blnk)then phas(kgen)=phas(kgen)+1 endif if(idam.eq.blnk)then phad(kgen)=phad(kgen)+1 endif write(10,1002)mam,ianm,isir,idam,kgen 1002 format(1x,i10,1x,a12,1x,a12,1x,a12,1x,i4) c 11 12 24 25 37 38 50 51 55 c -r56 -ka13a12 c Go To 10 20 write(17,1701)mam 1701 format(1x,i10,' Number of Animals') write(17,1705) 1705 format(/3x,'Info for Phantom Groups') do 32 m=1,50 if(phas(m).gt.0)go to 33 if(phad(m).lt.1)go to 32 33 write(17,1703)m,phas(m),phad(m) 1703 format(1x,i3,1x,2i10) 32 continue 31 continue c close(9) close(10) close(17) stop end