Same value assignment of multiple variables in a single statement

fortran, fortran95

Solution

Come on Fortranners, you know you want to ...

equivalence(a,b,c,d,e)

Now all those rascals are going to have the same value at all times.

Problem

Is there a way where I can assign the same value for different variables without constructing an array in a single statement? For example, if I have variables a,b,c,d, and e, can I assign something like ``` a=b=c=d=e=10.0 ``` ? I know that I can do in a single line: ``` a=10.0; b=10.0; c=10.0; d=10.0; e=10.0 ``` But that is not I want since if I want to change the value 10.0 later to something else, I have to make the change everywhere.

Original source