Opened 5 years ago

Closed 4 years ago

#246 closed Defect (fixed)

Compilation error with Intel Fortran

Reported by: ahilboll Owned by: ignacio
Priority: major Milestone: FLEXPART 10
Component: System aspects Version: FLEXPART 10.3
Keywords: Cc:

Description

When trying to compile the release-10 branch with Intel ifort, I get the error

ifort -c -I/opt/software/eb/software/ecCodes/2.12.5-iimpi-2019a/include -I/opt/software/eb/software/netCDF-Fortran/4.4.5-iimpi-2019a/include -O3  -g -fpp -fp-model source -mcmodel=medium -unroll -ipo -inline -heap-arrays 32 -xHost -traceback assignland.f90
concoutput_inversion.f90(357): error #6503: This keyword is invalid for this intrinsic procedure reference.   [UNIT]
            call flush(unit=unitrelnames)
-----------------------^
compilation aborted for concoutput_inversion.f90 (code 1)
make: *** [concoutput_inversion.o] Fehler 1

Compilation succeeds when I remove the call from that line, as shown in this patch:

diff --git a/src/concoutput_inversion.f90 b/src/concoutput_inversion.f90
index fb327cf..9562bd2 100644
--- a/src/concoutput_inversion.f90
+++ b/src/concoutput_inversion.f90
@@ -354,7 +354,7 @@ subroutine concoutput_inversion(itime,outnum,gridtotalunc,wetgridtotalunc, &
             open(unit=unitrelnames, file=path(2)(1:length(2))//'releases_out',form='formatted', &
                  & access='APPEND', iostat=ierr)
             write(unitrelnames,'(a)') areldate//areltime//'_'//anspec
-            call flush(unit=unitrelnames)
+            flush(unit=unitrelnames)
             close(unitrelnames)
           endif
         endif

After checking https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gfortran/FLUSH.html, it seems that recent Fortran compilers don't need the call any more. And indeed, on our system (gfortran 6.3.0) the modified code compiles as well.

So I suggest to apply the above patch.

Change History (3)

comment:1 Changed 5 years ago by pesei

My first impression is that flush is not needed at all. But I have never studied Rona's code and I am not certain.

comment:2 Changed 5 years ago by ignacio

  • Milestone set to FLEXPART 10
  • Owner set to ignacio
  • Status changed from new to accepted

The flush statement was removed in commit 10bfff9

comment:3 Changed 4 years ago by pesei

  • Resolution set to fixed
  • Status changed from accepted to closed
Note: See TracTickets for help on using tickets.
hosted by ZAMG