SUBROUTINE NUMBER(X,Y,HT,FLT,THETA,N) C C This subroutine is similar to symbol except that the C characters plotted are generated by conversion of a real number. C X,Y(real) = point where the symbol string begins if HT is positive C = point where the symbol string ends if HT is negative C HT(real) = absolute value of this number is the symbol height C if HT < 0 then center number about x,y C FLT(real) = the number to be plotted as a string symbol C THETA(real)=angle of rotation for the string,measured from +X axis C sign of theta used in conjunction with sign of HT to C center numbers (useful when making axes) C if theta < 0 then center the number about x,y on CW side C N(integer)= number of decimal places to use C = 0 no number after the decimal (point is still there) C = -1 no point is plotted C *** FLT is rounded in the direction of the sign before truncation. C If N <-1,IABS(N)-1 digits are truncated from the integer C portion after rounding. C common/pos/xpos,ypos dimension is1(20),ipack(10) byte string(20) XX=X YY=Y C If X=999 start symbol at X finish of last annotation C If Y=999 start symbol at X finish of last annotation IF(X.EQ.999.)XX=XPOS IF(Y.EQ.999.)YY=YPOS INDX=1 !pointer into IS1 for next byte IF(FLT.GE.0)GO TO 10 IS1(1)=45 !determine if FLT is -ve and put '-' is IS1 array INDX=INDX+1 10 ISGN=INDX-1 ROUND=.5 !calculate rounding factor IF(N.LT.1.AND.N.GT.-2)GO TO 20 NROUND=N IF(N.LT.-1)NROUND=N+1 ROUND=.5*(10.**(-NROUND)) 20 RNUM=ABS(FLT)+ROUND !sign bit already there: use ABSOLUTE value NBL=0 !NBL= number of bytes to left of decimal 30 IF(RNUM.LT.1.)GO TO 40 NBL=NBL+1 RNUM=RNUM*.1 GO TO 30 40 NBR=N !NBR= number of bytes to right of decimal IF(NBL.EQ.0)GO TO 60 IF(NBL.GT.6)ROUND=0. !if 7 digits to left of decimal-don't round RNUM=ABS(FLT)+ROUND DO 50 II=1,NBL !unpack FLT into IS1 array from 1's,10's,etc. IMSB=IFIX(AMOD(RNUM,10.)) RNUM=RNUM*.1 50 IS1(INDX+NBL-II)=IMSB+48 INDX=INDX+NBL 60 IF(ABS(FLT).GT.ROUND)GO TO 70 !check if this is 0 IS1(1)=48 INDX=2 ISGN=0 NBL=1 IF(NBR.LT.-1)NBR=-1 70 IS1(INDX)=46 INDX=INDX+1 IF(NBR.LT.1)GO TO 90 !output decimal places RNUM=ABS(FLT)+ROUND DO 80 II=1,N !unpack FLT into IS1 array from .1's,.01's,etc RNUM=AMOD(RNUM,1.)*10. !use only digits to the right of the decimal IMSB=IFIX(RNUM) IS1(INDX)=IMSB+48 80 INDX=INDX+1 90 NBTOT=ISGN+NBL+NBR+1 !total bytes=SIGN+NBL+NBR+DEC (NBTOT) XT=XX !find beginning point and call SYMBOL YT=YY 100 ENCODE(NBTOT,150,STRING)IS1 !convert to a Hollerith string 150 FORMAT(20A1) ILEN=LEN(STRING) !redetermine the length STRING(ILEN+1)=0 !INSERT NULL BYTE AS TERMINATOR CALL SYMBOL(XT,YT,HT,STRING,THETA,ILEN) RETURN END