35 SUBROUTINE get_bits(IBM,SGDS,LEN,MG,G,ISCALE,GROUND, &
81 CALL fndbit ( gmin, gmax, sgds, nbit, iscale, irett)
114 SUBROUTINE fndbit ( rmin, rmax, rdb, nmbts, iscale, iret )
117 integer,
intent(inout) :: iscale,nmbts
118 real,
intent(inout) :: rmin,rmax,rdb
119 real :: range,rr,rng2,po,rln2
120 integer :: iret,icnt,ipo,le,ibin
122 DATA rln2/0.69314718/
128 IF ( range <= 0.00 )
THEN
133 IF ( rdb == 0.0 )
THEN
136 ELSE IF ( rdb > 0.0 )
THEN
137 ipo = int(alog10( range ))
138 IF ( range < 1.00 ) ipo = ipo - 1
139 po = float(ipo) - rdb + 1.
141 rr = range * 10. ** ( -po )
142 nmbts = int( alog( rr ) / rln2 ) + 1
145 rng2 = range * 2. ** ibin
146 nmbts = int( alog( rng2 ) / rln2 ) + 1
151 IF(abs(rmin)>=1.)
THEN
152 iscale=-int(alog10(abs(rmin)))
153 ELSE IF (abs(rmin)<1.0.AND.abs(rmin)>0.0)
THEN
154 iscale=-int(alog10(abs(rmin)))+1
subroutine fndbit(rmin, rmax, rdb, nmbts, iscale, iret)
fndbit() computes the number of packing bits given the maximum number of significant digits to preser...