Is it correct that Fortran only supports ASCII identifiers (for variable / function / module names)? It looks like gfortran and ifx both complain about “Invalid character” or “Unrecognized token” when compiling something like:
program unicode
implicit none
real, parameter :: π = 3.14159
real, parameter :: ß = 1.23
real, parameter :: µ₀ = 4 * π * 1e-7
integer :: i
real :: Δt, ω
real :: t(4)
real :: ϕ(4)
real :: Aₙ(100)
Δt = 0.1
ω = 2.0
t = [(Δt*real(i), i = 1, 4)]
ϕ = [π/4, π/2, 3*π/4, π]
print *, µ₀*cos(ω*t + ϕ) - ß
end program unicode
I suppose things could get carried away, and might be hard for maintenance if you don’t have a setup to type these easily (I use vim, and have imap mappings from Latex-like modifiers, so \omega becomes ω, etc… Just making sure I’m not missing some command-line option.
Thanks!
(speaking of getting carried away…)
ℝ :: ω, ℓ, k, E₁
ℤ :: n
ω = √(k/ℓ)
if (n ≥ 4) then
E₁ = ½·m·v²
!∇⨉B = µ₀·(J + ε₀·∂E/∂t)
end if
The fortran standard defines a fortran character set, and then all of the language is defined in terms of those characters. It does not define the binary representation of those characters, so each compiler is free to map its native characters to the fortran character set however it wants.