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

So, before you use MER, you must assign a value to it. This applies to all the variables mentioned above. Make sure they are all assigned a value before they are used.In summary, the type of variables in FORTRAN are determined by their names, with those starting with i, j, k, l, m, or n being INTEGER and the rest being REAL. It is important to assign a value to all variables before using them to avoid the "used before defined" warning.
  • #1
nnnnn
5
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
  • #2


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.
 
  • #3
!

Hello! I would be happy to help you with your questions.

1. The type of variables in FORTRAN is determined by the data type declaration. Without knowing the specific data type declaration for each variable, it is difficult to determine the exact type. However, based on the variable names, it is likely that "mer" is a numeric variable, while "tmpmonth", "tmpday", and "tmpyear" are likely to be integer variables. "tmphour", "tmpminute", "tmpsecond", and "tmphund" could be either integer or floating-point variables, depending on how they are used in the program.

2. The warning message "Variable MER is used before its value has been defined" means that the variable MER is being used in the program before a value has been assigned to it. To fix this, you need to assign a value to the variable before using it in the program. This applies to all variables in the program - they must be defined and given a value before being used. This can be done by using an assignment statement in the program, such as "MER = 0" to assign a value of 0 to the variable MER. It is important to properly define and assign values to all variables in a program to avoid any errors or unexpected results.

I hope this helps answer your questions. Best of luck with your programming!
 

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

1. What are the different types of variables in scientific research?

The three main types of variables in scientific research are independent, dependent, and controlled variables. Independent variables are manipulated by the researcher and are believed to have an effect on the dependent variable. Dependent variables are measured or observed and are affected by the independent variable. Controlled variables are kept constant throughout the experiment to eliminate any potential confounding factors.

2. What is a mer variable?

A mer variable is a categorical variable that has more than two possible values. This type of variable is often used to group data into different categories, such as gender, race, or occupation.

3. How are time variables used in scientific research?

Time variables, such as tmpmonth, tmpday, tmphour, and tmpminute, are often used to measure and track changes over time. They can be used to study patterns, trends, and relationships between variables. Time variables are also important for conducting experiments and collecting data at specific time intervals.

4. What is the difference between a continuous and discrete variable?

Continuous variables can take on any value within a certain range, while discrete variables can only take on specific, separate values. For example, temperature is a continuous variable because it can be measured at any point on a scale, while number of siblings is a discrete variable because it can only take on whole numbers.

5. How do researchers determine which type of variable to use in their study?

The type of variable used in a study depends on the research question and the hypothesis being tested. For example, if the researcher is interested in the effect of a certain treatment on a specific outcome, they would use an independent and dependent variable. If the researcher wants to compare differences between groups, they may use a mer variable. Ultimately, the type of variable used should be chosen based on its relevance to the research question and its ability to provide meaningful results.

Similar threads

  • Programming and Computer Science
Replies
4
Views
873
  • Programming and Computer Science
Replies
2
Views
1K
Replies
63
Views
4K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
3
Views
525
  • Programming and Computer Science
Replies
3
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
9
Views
1K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
12
Views
1K
Back
Top