Haven't had a chance to try this out, but can IOMSG= keyword in I/O operations now accept an ALLOCATABLE character variable? That is, is the following code compliant with the latest Fortran standard?
CHARACTER(LEN=:), ALLOCATABLE :: ErrorMessage ... OPEN(NEWUNIT=UnitNum, FILE=SomeFile, IOMSG=ErrorMessage, IOSTAT=ErrorCode)
It is unclear from the User and Reference Guide for the Intel® Fortran Compiler 14.0:
I/O Message Specifier (IOMSG=) The I/O message specifier designates a variable to contain the message to be returned when an I/O error occurs. It takes the following form: IOMSG=msg-var msg-var Is a scalar default character variable. If an error (ERR=), end-of-file (END=), or end-of-record (EOR=) condition occurs during execution of an I/O statement,msg-varis assigned an explanatory message. If no error occurs, the value of the variable remains unchanged.