Type of variables mer ,tmpmonth, tmpday,tmphour,tmpminute

  • Thread starter Thread starter nnnnn
  • Start date Start date
  • Tags Tags
    Type Variables
Click For Summary
SUMMARY

The discussion focuses on the variable types in FORTRAN, specifically for the variables "mer", "tmpmonth", "tmpday", "tmphour", "tmpminute", and others. According to established conventions from older FORTRAN versions like FORTRAN 77, variable names starting with letters i through n are classified as INTEGER, while those starting with other letters are classified as REAL. Therefore, "mer" is identified as INTEGER, while the other variables are classified as REAL. Additionally, it is crucial to define variables before use to avoid warnings such as "Variable MER is used before its value has been defined."

PREREQUISITES
  • Understanding of FORTRAN programming language
  • Familiarity with variable naming conventions in programming
  • Knowledge of data types: INTEGER and REAL
  • Basic debugging skills to handle variable definition warnings
NEXT STEPS
  • Research FORTRAN 77 variable naming conventions
  • Learn about variable initialization in FORTRAN
  • Explore data type handling in modern FORTRAN versions
  • Study best practices for variable management in programming
USEFUL FOR

Programmers working with FORTRAN, especially those maintaining legacy code, and anyone interested in understanding variable types and initialization in programming languages.

nnnnn
Messages
5
Reaction score
0
type of variables " mer ,tmpmonth, tmpday,tmphour,tmpminute"

May you kindly help me with :

1 . the type of following variables ( in FORTRAN ) ?

mer ,
tmpmonth, tmpday, tmpyear and
tmphour,tmpminute,tmpsecond,tmphund

2 . " Warning: Variable MER is used before its value has been defined "
how it must be defined ? and also about all above variables .

Much much thanks
 
Technology news on Phys.org


For 1, I don't know if the current versions of FORTRAN still do this, but the older versions, like FORTRAN 77, used to assocation types with variable names. Names that started with i, j, k, l, m, or n were INTEGER. Variable names that started with other letters were REAL.

So, if that rule is still applicable, mer is of type INTEGER, and all the others are of type REAL.

2. You should never use a variable before it has been defined; i.e., given a value.
 

Similar threads

  • · Replies 25 ·
Replies
25
Views
4K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
Replies
4
Views
4K
  • · Replies 4 ·
Replies
4
Views
1K
Replies
65
Views
5K
  • · Replies 43 ·
2
Replies
43
Views
5K
  • · Replies 27 ·
Replies
27
Views
1K
  • · Replies 59 ·
2
Replies
59
Views
12K