variable format expression

Is there an equivalent expression in PGHPF for variable format expression as it is used in Compaq Visual Fortran, e.g.

10 Format (<i> Ed.w)

where i is an integer variable.
I do know that pgf77 knows this syntax, too…
Thanks for your help!!!

Hi Reto,

It’s a bit embarssing that we support the runtime edit decriptor extension in pgf77 but not pgf90 or pghpf. I’m not sure of the reasons but I’ll bring it up with our senior compiler architect and see if we can added it to a future release.

For now however, you’ll need use a do loop and non-advancing IO to make this work.

Example:

     PROGRAM test
     REAL X(4)
     DO I=1,4
          X(I) = (0.25 / I )
     END DO
     DO I=1,4
           WRITE(*,10,ADVANCE='NO'), X(I)
     END DO
     WRITE(*,*) ' '
  10 FORMAT(E16.8)
     END

Obviously, not as elegant but will work for this simple case. Another idea would be to write a F77 IO library which contains subroutines that use the runtime edit descriptor. This might be overkill for a simple case, but for more complex runtime edit descriptors this might be the way to go. Of course, I have not tried this myself, but it seems like a resonable solution.

Hope it helps,
Mat