I've been told in an introductory course on programming that a character constant in Fortran95 can be declared without any length specification, e.g.:
character, parameter :: STR = 'Hello World!'
The same statement can be found in Stephen J. Chapman's book “Fortran 95/2003 for Scientists and Engineers” (p. 34), which says
If the named constant is of type CHARACTER, then it is not necessary to declare the length of the character string. Since the named constant is being defined on the same line as its type declaration, the Fortran compiler can directly count the number of characters in the string. For example, the following statements declare a named constant error_message to be the 14-character string ‘Unknown error!’.
CHARACTER, PARAMETER :: ERROR_MESSAGE = 'Unknown error!'
I know that it is possible to use (len=*). But is it actually
possible to omit the length selector entirely?
When I tested it with the GFortran and Intel compilers, the value was always truncated to the first character. Is there another compiler that supports this? Or can someone point me to a part of the Fortran standard which clarifies this?