×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Confused by DATA

Confused by DATA

Confused by DATA

(OP)
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

RE: Confused by DATA

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

RE: Confused by DATA

(OP)
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

RE: Confused by DATA

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close