I have a large Fortran code which uses the Merge function in named constant (parameter) declaration. But, there is a problem in compilation.
To explain the problem, a simple code is
CHARACTER*3,PARAMETER :: Mode = 'yes' ! 'yes' or 'no'
INTEGER,PARAMETER :: L = merge(1,2, trim(Mode) .eq.'yes')
INTEGER,DIMENSION(L) :: some_array
(One changes Mode depending on the purpose. Actual code is more complex, of course.)
The points are (1) parameter 'L' is initialized depending on 'Mode' (2) parameter 'L' is used to define other arrays.
This initialization of 'L' is okay for recent compiler.
However, the cluster machine has older version (around year 2013) of Fortran compiler, which does not accept this way of initialization of 'L'.
How can I achieve the same effects in old Fortran standard?