The question is essentially equivalent to the alternative question: can I convert an integer to a character in a constant expression?
Yes you can, but you are limited in how this can be done.
One way would be:
implicit none
character, parameter :: digit(0:*) = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
integer i
character :: number(3) = [(digit(i), i=2, 8, 3)]
print '(A)', number
end
And there are other ways, such as using ACHAR.
Once you know how to get a single character you can use the natural extensions, such as
character(8) :: label(5) = 'ens_000'//[(digit(i), i=1, 5)]
And so on, extending to tens, hundreds and more if you find the appropriate logic:
integer j
character(2), parameter :: twodigit(0:*) = [((digit(i)//digit(j), j=0,9), i=0,9)]
character(8) :: label(12) = 'ens_0'//[(twodigit(i), i=11, 22)]
You cannot use an internal write (or other executable statement) or a user-defined function in the constant expression.
This does quickly become silly as the number of digits increases, but it's also possible to use indexes (or substrings) and arithmetic:
character(8) :: label(12) = 'ens_0'//[(digit(i/10)//digit(mod(i,10)), i=11, 22)]
(Recall if using them that substrings are always 1-indexed.)