subroutine cvtaf( num, f ) external len c c converts ascii string in num to floating point after removing leading c and trailing blanks. c byte num(1,1), array(50) real*8 f call scopy( num(1,1), array(1) ) ! copy to local array call trim ( array(1) ) ! remove trailing blanks call trim0( array(1) ) ! remove trailing ASCII 0's call strip ( array(1) ) ! remove leading blanks call strip0( array(1) ) nchrs = len( array(1) ) decode( nchrs, 201, array(1), err=300 ) f 201 format( f20.10 ) return 300 call error( '?CVTAF-', 'F', '-decode conversion error' ) return end subroutine cvtfa( f, num ) external len c c floating point number to ascii for display c c should return error if too large or small c real*8 f, ftemp integer minus byte num(1,1), array(50) encode( 22, 201, array(1), err=900 ) f 201 format( f22.10 ) c 10000000000 if ( f .ge. 100000000.0 ) then call error( '?CVTFA-', 'W', '-Overflow' ) else if ( f.lt. .000000001 .and. f.ne.0. ) then call error( '?CVTFA-', 'W', '-Underflow' ) end if c remove leading and trailing blanks array(50) = 0 ! ensure null somewhere call trim ( array(1) ) ! remove trailing blanks/0 call trim0( array(1) ) call strip ( array(1) ) ! remove leading spaces nchrs = len( array(1) ) array(12) = 0 ! max 11 chrs displayed call rshift( array(1), 11 - nchrs ) ! shift to right c and if last character is ., then lshift and put in space instead if ( array(11) .eq. '.' ) then call lshift( array(1), 1 ) array(11) = ' ' array(12) = 0 end if call scopy( array(1), num(1,1) ) return 900 call error( '?CVTFA-', 'F', '-Encode conversion error' ) return end