49 SUBROUTINE get_bits(IBM,SGDS,LEN,MG,G,ISCALE,GROUND, &
55 REal,
DIMENSION(LEN),
intent(in):: g
56 real,
DIMENSION(LEN),
intent(inout) :: ground
57 integer,
DIMENSION(LEN),
intent(in):: mg
58 integer,
intent(in) :: ibm,len
59 integer,
intent(inout) :: iscale,nbit
60 real,
intent(out) :: gmax,gmin
76 IF(mg(i)/=0.AND.i1==0) i1=i
78 IF(i1>0.AND.i1<=len)
THEN
95 CALL
fndbit( gmin, gmax, sgds, nbit, iscale, irett)
128 SUBROUTINE fndbit ( rmin, rmax, rdb, nmbts, iscale, iret )
131 integer,
intent(inout) :: iscale,nmbts
132 real,
intent(inout) :: rmin,rmax,rdb
133 real :: range,rr,rng2,po,rln2
134 integer :: iret,icnt,ipo,le,ibin
136 DATA rln2/0.69314718/
142 IF ( range <= 0.00 )
THEN
147 IF ( rdb == 0.0 )
THEN
150 ELSE IF ( rdb > 0.0 )
THEN
151 ipo = int(alog10( range ))
152 IF ( range < 1.00 ) ipo = ipo - 1
153 po = float(ipo) - rdb + 1.
155 rr = range * 10. ** ( -po )
156 nmbts = int( alog( rr ) / rln2 ) + 1
159 rng2 = range * 2. ** ibin
160 nmbts = int( alog( rng2 ) / rln2 ) + 1
165 IF(abs(rmin)>=1.)
THEN
166 iscale=-int(alog10(abs(rmin)))
167 ELSE IF (abs(rmin)<1.0.AND.abs(rmin)>0.0)
THEN
168 iscale=-int(alog10(abs(rmin)))+1
subroutine get_bits(IBM, SGDS, LEN, MG, G, ISCALE, GROUND, GMIN, GMAX, NBIT)
get_bits() computes number of bits and round field.
subroutine fndbit(rmin, rmax, rdb, nmbts, iscale, iret)
fndbit() computes the number of packing bits given the maximum number of significant digits to preser...