This answer was designed by Mr. Rafael Isassi who wrote this lines:
c Just write your number to a string, or read your number from a string,
C instead of to or from an I/O unit (the fortran I/O routines perform the
C conversion). Example:
C To convert to a string:
character*10 string, format
data format /'(F10.2)'/
a=3.1416
write(string,format)a
C now print your string...
print *,string
C To convert a string to a floating point number:
string='123456.789'
read(string,*)b
C now print your number...
print *,b
Here's another example of what KKnowle2 showed you in his reply:
It's in Fortran90/95, however the Fortran77 code would be almost identical...
( (10) and ! used for comments are not F77 compatible )
Character(10) string
Real x, y
x = 53.65 ! assign an initial value to x, 53.65
Write( string, '(f10.2)' ) x ! writes 53.65 into the string
Read( string, '(f10.0)' ) y ! reads the value from string and assigns it to y
End ! note the f10.0 format is nice... you don't have
! to know in advance where the decimal pt lies.
Dan