Understanding of Declaration

Understanding of Declaration

Hi friends,

My co. has given me a task of learning Fortran as we want to upgrade some of our models. While studying the code I cam across the foll statements and not able to understand what exactly is the meaning of it.

INTEGER Z
PARAMETER (Z = 5)

LOGICAL X(Z)
REAL*8 Y(Z)

LOGICAL A,B,C,D
COMMON /DEC/ A,B,C,D

Please help me as I am new to fortran.

Thanks in advance

2 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

Hi Arnie

using the  constant value ("PARAMETER")  Z=5,  you are  defining  an

- array of 5 logical ( "boolean" ) objects X(1), ... X(5)

- an array  of 5 double precision (64 bit) floating point objects  Y(1) ... Y(5)

- 4 scalar logical variables you map to a named ( name is "DEC")  COMMON BLOCK. The COMMON BLOCK ( and thus these 4 variables) can be accessed by other subroutines  too without passing them as arguments - thus some kind of global variables in Fortran. .

There is a lot of nice material available on the WEB to introduce you to Fortran like tutorials etc. You might want to search for it to find more about COMMON BLOCKs etc

Melden Sie sich an, um einen Kommentar zu hinterlassen.