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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

general fortran ?'s 1

Status
Not open for further replies.

bobo12

Programmer
Dec 26, 2004
74
US
hi,
i've noticed that in fortran, it is legal to write AVE=0 without actually declaring previously what AVE is, whether char or int or whatever. can anyone confirm my understanding is true?

suppose i have the following...
WRITE (7,28) ALP
what do the #'s 7, and 28 correspond to? i noticed that there are sometimes (*,*). what do these placeholders mean?

what does this mean?
FORMAT (125A1)
what is FORMAT used to do? is it to truncate #'s and that sort of thing.
 
By default, identifiers beginning with letters I-N are integers. Everything else is real unless explicitly declared. To find out what the identifiers used are, you could put

IMPLICIT COMPLEX (A-Z)

at the top of each routine. This forces all identifiers to be complex - that means if you do not declare them, they are complex numbers so something like

I = 0

would be illegal unless I was explicitly declared as an integer.
Code:
WRITE(7,28)
7 is the channel number. The C equivalent is something like
Code:
FILE* chan7;
chan7 = fopen ("whatever", "w");
28 is the label of the format. The format is similar to the first parameter of printf in C.

Code:
FORMAT(125A1)
Prints up to 125 characters.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top