Fortran Understanding Common Blocks in Fortran 77

  • Thread starter Thread starter *FaerieLight*
  • Start date Start date
  • Tags Tags
    Blocks Fortran
AI Thread Summary
In Fortran 77, a common block, such as "common /hmat/ a,b,c,d", allows multiple variables (a, b, c, d) to share the same memory space identified by the name "hmat". The common block does not require prior definition of "hmat"; it can be introduced directly in the common block statement. To access the variables stored in "hmat", one typically uses the same common block declaration in any program unit that needs to access those variables. This facilitates data sharing across different program units without the need for explicit passing of variables. For further guidance, a tutorial link on named common blocks is provided for additional context.
*FaerieLight*
Messages
43
Reaction score
0
Hi

I'm having some trouble with understanding the whole concept of the common block in Fortran 77.

Here is an example:

common /hmat/ a,b,c,d

It means that all the variables a,b,c,d are all contained in hmat. But does hmat need to be defined previously for the above example to make sense? Or can the first time you refer to it be in a common block code, as above? And if all the variables are stored in hmat, how do I open hmat to see them?

Thanks
 
Technology news on Phys.org
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
Thread 'Project Documentation'
Trying to package up a small bank account manager project that I have been tempering on for a while. One that is certainly worth something to me. Although I have created methods to whip up quick documents with all fields and properties. I would like something better to reference in order to express the mechanical functions. It is unclear to me about any standardized format for code documentation that exists. I have tried object orientated diagrams with shapes to try and express the...

Similar threads

Replies
22
Views
4K
Replies
59
Views
11K
Replies
3
Views
2K
Replies
8
Views
6K
Replies
3
Views
8K
Replies
4
Views
2K
Back
Top