c c reformat conformation data c character*12 anim,farm,blnk character*6 judgID real*8 tm(25,5),x,z,dx,dx2 integer parity,jdate,bdate,cdate integer jyy,jmm,jdd,byy,bmm,bdd,cyy,cmm,cdd integer tr(25),tlast,pard(10),agej,agec integer jug,birt,calv open(10,file='TYP01.d',form='formatted',status='old') open(15,file='TYP02.d',form='formatted',status='unknown') nol=0 tm=0.d0 do 5 k=1,25 tm(k,4)=100 5 continue pard=0 mam=0 blnk=' ' 10 read(10,1010,end=50)jyy,jmm,jdd,anim,byy,bmm,bdd,judgID, x farm,parity,cyy,cmm,cdd,tr 1010 format(i4,1x,i2,1x,i2,1x,a12,1x,i4,1x,i2,1x,i2,1x, x a6,a12,i3,i4,1x,i2,1x,i2,1x,25i3) mam=mam+1 jdate = jyy*10000 + (jmm*100) + jdd bdate = byy*10000 + (bmm*100) + bdd cdate = cyy*10000 + (cmm*100) + cdd jug=0 birt=0 calv=0 call perpd2(jdate,jug) call perpd2(bdate,birt) call perpd2(cdate,calv) aj = jug - birt ac = calv - birt aj=(aj/30.5)+0.500001 ac=(ac/30.5)+0.500001 agej=aj agec=ac if(agej.lt.0)agej=20 if(agec.lt.0)agec=20 if(mam.lt.3)print *,anim,jdate,tr if(parity.gt.10)parity=10 if(parity.lt.1)parity=10 write(15,1510)anim,farm,jdate,bdate,cdate,agej,agec, x judgID,parity,tr 1510 format(1x,a12,1x,a12,3i9,2i7,a6,i3,25i3) c 13 14 26 53 67 73 76 151 c -r152 -ka2a12a27a9 animal, judge date k=parity if(k.gt.9)k=10 if(k.lt.1)k=10 pard(k)=pard(k)+1 if(tr(1).gt.9)then tr(1)=1 nol=nol+1 endif do 20 k=1,25 if(tr(k).gt.0)then tm(k,1)=tm(k,1)+1.d0 z=tm(k,1) x=tr(k) dx = x - tm(k,2) tm(k,2)=tm(k,2)+ (dx/z) dx2 = dx*(x-tm(k,2)) - tm(k,3) if(tm(k,1).gt.1)tm(k,3)=tm(k,3)+dx2/(z-1.d0) if(x.lt.tm(k,4))tm(k,4)=x if(x.gt.tm(k,5))tm(k,5)=x endif 20 continue go to 10 50 print *,mam,' Records' print *,pard,' parities' close(10) close(15) do 60 k=1,25 x=tm(k,2) z=tm(k,1) dx2=tm(k,3) dx = dsqrt(dx2) print 1020,k,z,x,dx,tm(k,4),tm(k,5) 1020 format(1x,i4,2f10.0,f12.3,2f10.0) 60 continue print *,nol,' nol' stop end include 'perpd2.f'