subroutine ticks (rmax,rmin,rup,rlo,ticpx,ticpn,nticx,nticn, & ticlex,ticlem,raxbas,rinbas,ticp,tico, & recrup,range,ntic,ticlen) c c-----adjust the no. of ticks by the length of ticks if (ticlex.eq.ticlem) go to 3230 unilen=amin1 (ticlex,ticlem) duniln=amax1 (ticlex,ticlem) if (unilen.eq.0.) unilen=duniln xona= (raxbas/rinbas) rxonrn=abs (rmax/rmin) rxmirn=(rmax-rmin)/raxbas igt=0 if ( rxmirn.gt.30. ) igt=5 if ( (abs(rmax).gt.abs(rmin)) .and. igt.eq.5 ) igt=1 if ( (abs(rmin).gt.abs(rmax)) .and. igt.eq.5 ) igt=2 d type *,' raxbas,rinbas,xona,rxmirn,igt ',raxbas,rinbas, d & xona,rxmirn,igt if (xona.lt..011 .or. rxonrn.le..05 .or. igt.eq.2 ) & go to 3120 if (xona.gt.99. .or. rxonrn.ge.20. .or. igt.eq.1 ) & go to 3110 if (xona.lt.99. .and. xona.gt..011) go to 3200 c-----large difference between max. & min. 3110 tico=0. ticp=ticpx unilen=ticlex go to 3140 3120 ticp=0. tico=ticpn unilen=ticlem 3140 dumlen=unilen aran=abs (ticp-tico) div=aran/dumlen d type *,' <3140>... ' d type *,' div,dumlen,tico,ticp ',div,dumlen,tico,ticp go to 3255 c---------------------------------------------------------- 3200 ticpxx=amin1 (ticpx,rmax) ticpnn=amin1 (ticpn,rmin) ran=ticpxx-ticpnn icount=1 dumlen=unilen 3221 div=ran/dumlen rem=amod(ran,dumlen) d type *,' <3221>-loop--------- ' if (rem.eq.0..and.div.gt.10.) go to 3224 if (rem.eq.0..and.div.le.10.) go to 3250 rup=rmax tico=ticpn irecd=ifix(div+.01) ticp=ticpn+dumlen*irecd d type *,' unilen,icount,dumlen,div ',unilen,icount, d & dumlen,div d type *,' rup,tico,ticp,irecd ', rup,tico,ticp,irecd if (div.le.10.) go to 3255 3224 icount=icount+1 dumlen=unilen*icount rup=rmax go to 3221 c-----'ticlem' & 'ticlex' are equal 3230 dumlen=ticlex div=float(nticn+nticx) 3250 tico=ticpn ticp=ticpx d type *,' <3250>... ' d type *,' ticp,tico,div,dumlen ',ticp,tico,div,dumlen c-----limit the no. of ticks to less than 8 3255 if (div.le.10.) go to 3256 div=div/2. idiv=ifix(div/2.) dumlen=dumlen*2. if ( float(idiv).eq.div ) go to 3259 rup=rmax go to 3259 3256 numv=int (div) remv=div - float(numv) if (div.lt.0.0) type *,' ERROR! <1> div is negative!! ' if (remv.ge.0.5) numv=numv+1 3258 idiv=numv d type *,' <3258>... ' d type *,' div=',div,' remv=',remv,' idiv=',idiv 3259 go to (3280,3280,3300,3300,3300,3270,3300,3270, & 3260,3270) idiv 3260 dumlen=dumlen*3 div=div/3. go to 3300 3270 dumlen=dumlen*2. div=div/2. go to 3300 3280 dumlen=dumlen/2. div=div*2. 3300 numt=int (div) remt=div - float(numt) if (div.lt.0.0) type *,' ERROR! <2> div is negative!! ' if (remt.ge.0.5) numt=numt+1 3320 ntic=numt ticlen=dumlen range=ticpx-ticpn recrup=ticlen*ntic d type *,' <3300>... ' d type *,' recrup=',recrup,' ticlen=',ticlen,' ntic=',ntic d type *,' rlo=',rlo,' rup=',rup d type *,' range=',range,' ticpx=',ticpx,' ticpn=',ticpn d type *,' ticp =',ticp,' tico =',tico return end