Cannot compile Fortran F77 Variable Format Expressions Variable format expressions "<..>" using latest pgf77

Hello Everyone,

I wonder if anyone knows why it is not possible to compile the following code:

write(FUGAP,620) istep,deps0,pmf_1,nresn,
 $             (density(i),i=1,nresn),fix_pmf,lamda_pmf,d_lamda

620 format(i20,f12.8,f5.2,i5,f7.4,2x,i2,2(2x,f10.7),2x,a)

using pgf77 from the latest NVidia HPC SDK. Note that the same piece of code can be compiled using pgf77 from PGI 18.4 or lower versions.

Thank you very much in advance for any response to this topic.


Hi Veselin,

There’s nothing obviously wrong here and when I try to recreate the issue, the code compiles fine. Can you please post a small reproducing example which show the error?

% cat tmp.f
      write(*,620) istep,deps0,pmf_1,nresn,
     $             (density(i),i=1,nresn),fix_pmf,lamda_pmf,d_lamda
620   format(i20,f12.8,f5.2,i5,f7.4,2x,i2,2(2x,f10.7),2x,a)
% pgf77 -c tmp.f


Hello Mat,

The forum’s HTML code hides the full example by masking a whole line. So you do not see the Variable Format Expressions code, which causes the problem.

Given bellow is the F77 test code uploaded on GitHub:

If you try to compile that code by means of NVidia HPC SKD pgf77 compiler you will get the following fatal error:

Now I think you can see the problem in details.

Note that if I use PGI Compilers 18.4 to compile the F77 code shown above it gets compiled.

Thank you very much in advance for your efforts to investigate the problem.

Thanks, that makes more sense.

We decide to not carry forward non-standard F77 extensions, including variable format expressions.

Please consider updating your code. The following page for gfortran shows standard compliant ways to achieve this:

Hope this helps,

Thank you for the explanation. We hoped to solve the problem without re-writing the code but if changing the code is the only option we shall go that way.