Help with FORTRAN: 200,100,100 & 1H1 Interpretation

  • Fortran
  • Thread starter Arokiamary
  • Start date
  • Tags
    Fortran
In summary: In the above program.. what does (200,100,100) in the 4th line mean? Maybe, but unix still understands this stuff - for example the -f option on the lpr command.
  • #1
Arokiamary
1
0
Please help ! FORTRAN ..

SUBROUTINE PRGTAC
COMMON IA(2),IB(2),J,JSUM,IFL
NR=4000-JSUM
IF(NR-51) 200,100,100
100 JSUM=0
RETURN
200 IF(NR.EQ.6 .OR. NR.EQ.7) PRINT 1
1 FORMAT(1H1)



In the above given lines from a program.. What does the 4th line intepret ? (200,100,100)
and what does 1H1 in the format mean ? .. Thank you :)
 
Technology news on Phys.org
  • #3


Arokiamary said:
In the above program.. what does (200,100,100) in the 4th line mean?
It's an arithmetic if statement, which goes to the first statement number (in this case 200) if the result is negative, second statement number if the result is zero (in this case 100), and the third statement number if the result is positive (in this case also 100). The GOTO(...)IFL is a computed goto statement, where IFL indexes the list of statement numbers in (...).

Arokiamary said:
Can someone help me with the format explanation too ?
The 1H1 means one "Hollerith" character, in this case '1'. It's an old method for specifying characters, you could probably use '1' instead. My guess is that on the machine this code was written for, a '1' as the first character of output on a line cause a page eject. '+' would cause an overwrite. '0' would double space, and a space (' ') would produce a normal line. '/', is probably 'end of record' so '//' should should cause a double space.

This must be really old code.
 
Last edited:
  • #4


Arokiamary said:
In the above program.. what does (200,100,100) in the 4th line mean ? Can someone help me with the format explanation too ?
Welcome to PF. You should post your question to only one thread, and wait for an answer there. It is better to start a new thread for your question, since it is not on the specific tpoic of the post where you have piggybacked it.

I see you already got your answer to the computed IF statement in another thread. For help with other FORTRAN statements I suggest you do a google search. As for the H in the FORMAT statement, I recall that H stands for Hollerith. Here is more detail: "gcc.gnu.org/onlinedocs/.../gfortran/Hollerith-constants-support.html"

Good luck. When experimenting, never hesitate to modify a line of code to investigate how your change causes it to run differently. You'll learn a lot through trial and error; and even better, you'll remember it! :smile:
 
Last edited by a moderator:
  • #5


I've merged multiple replies from different threads, into a single thread.
 
  • #6


rcgldr said:
The 1H1 means one "Hollerith" character, in this case '1'.
...
This must be really old code.

Maybe, but unix still understands this stuff - for example the -f option on the lpr command.
 

Related to Help with FORTRAN: 200,100,100 & 1H1 Interpretation

What is FORTRAN and why is it important?

FORTRAN (Formula Translation) is a high-level programming language used for scientific and engineering applications. It was one of the first programming languages and is still widely used today due to its efficiency and ability to handle complex mathematical calculations.

What does the code "200,100,100 & 1H1" mean in FORTRAN?

The numbers separated by commas represent the dimensions of an array or matrix in FORTRAN. In this case, the code indicates a 3-dimensional array with dimensions of 200, 100, and 100. The "1H1" signifies a space character.

What is the purpose of the "Interpretation" in FORTRAN?

The "Interpretation" in FORTRAN refers to the process of translating the code written in the programming language into machine-readable instructions that the computer can execute. It is an essential step in the execution of any program.

Can you explain the difference between FORTRAN 200 and FORTRAN 100?

FORTRAN 200 and FORTRAN 100 are different versions of the FORTRAN programming language. FORTRAN 200 is a newer version and includes more features and enhancements compared to FORTRAN 100. These versions also have different syntax and may require different compilers to run.

What resources are available for help with FORTRAN?

There are several resources available for help with FORTRAN, including online forums, tutorials, and documentation. Some universities and institutions also offer courses and workshops on FORTRAN programming. Additionally, many programming communities have experts who are willing to assist with specific questions or problems related to FORTRAN.

Similar threads

  • Programming and Computer Science
Replies
12
Views
2K
  • Programming and Computer Science
Replies
6
Views
3K
  • Programming and Computer Science
Replies
8
Views
3K
  • Programming and Computer Science
Replies
6
Views
3K
  • Programming and Computer Science
Replies
22
Views
4K
  • Programming and Computer Science
Replies
4
Views
2K
  • Programming and Computer Science
Replies
14
Views
1K
  • Programming and Computer Science
Replies
6
Views
2K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
6
Views
1K
Back
Top