Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Variable Format Expressions IVF 8

jancer
Beginner
634 Views
Taking my first steps in CVF 6.1 to IVF 8 conversion I encountered an unexpected problem with variable format expressions:

In a subroutine I have the following two lines:

WRITE(21,61) TRIM(chTempDir)
61 FORMAT('d ',aLEN_TRIM(chTempDir))

(please replace the by angle brackets. I can't use them here because I "don't have permission to post HTML".)

where chTempDir is of type CHARACTER(LEN=200) and made available via a use statement. Its value is set in the program unit that calls the subroutine in question.

My variable format expression used to work fine in CVF6.1 but now the value of chTempDir is deleted upon entry into the subroutine (as can be seen by adding a WRITE(*,*) chTempDir line at the top of my subroutine).

When I replace my variable format by a200, everything works fine again.

What's my mistake?

Thank,
Jan Cermak
0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
635 Views

Sounds like a compiler bug, and you should report it to Premier...

...however, you don't seem to be aware of a simpler, standard & portable way: plain A edit descriptor (without length specifier):

WRITE(21,"('d ', a)") TRIM(chTempDir)

which means exactly

WRITE(21,"('d ', a[LEN(Associated_IOitem)])") TRIM(chTempDir)

i.e.

WRITE(21,"('d ', a[LEN(TRIM(chTempDir))])") TRIM(chTempDir)

Jugoslav

Message Edited by JugoslavDujic on 03-22-2004 08:36 AM

0 Kudos
Steven_L_Intel1
Employee
635 Views

One would need to see the full example, and the best place to do that is to send to Intel Premier Support. I know that early versions of the compiler had problems with "uplevel references".

Do try the latest compiler before reporting the problem.

0 Kudos
Reply