Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Confused by DATA

Status
Not open for further replies.
Apr 2, 2014
2
0
0
GB
Hi,

I am translation some Fortran to Java and would appreciate some help to understand what the DATA below means.


DOUBLE PRECISION FUNCTION BESFJ1(X)

DOUBLE PRECISION X
DOUBLE PRECISION SRNAME

DATA SRNAME /8H BESFJ1 /

Is there now some equivalence between BESFJ1 and SRNAME ? what does the 8H signify ?

thanks
David
 
Today, a Fortran programmer would write :

CHARACTER(8) :: SRNAME=' BESFJ1 '

! please notice the spaces at first and last positions...

8H means that 8 characters (Hollerith form). But this is a very old form (Fortran 66 => 50 years ago), when Fortran did not have character variables, i.e. when it was "normal" to store characters within real or integer values.

François Jacq
 
Thank you François,

I might never have guessed that it was a String being loaded into the storage of a double.

On reflection the identifier SRNAME was a good hint that something stringy was going on but I was thrown by the type DOUBLE PRECISION and was convinced that something strangely numerical was happening with the function address.

This old fortran is full of stuff I will try to google but more questions are inevitable so please stay tuned.

David
 
Using doubles to store characters is a very old style of programming - you've probably gotten it from a Fortran IV (F66) program from a 16-bit mini. The later versions of Fortran (since F77) have character handling. It would be better if you used the character handling features.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top