Unexpected syntax error compiling HYCOM with gfortran 8.2.1 at mod_stokes.F

19 views
Skip to first unread message

alvaroafe...@gmail.com

unread,
Feb 1, 2019, 7:18:12 PM2/1/19
to HYCOM.org Forum
Good evening,

I am compiling HYCOM 2.2 with gfortran 8.2.1 on a RHEL 7.5 box. I am trying to run a hybrid run, so this time I added the flag -fopemmp (as per https://gcc.gnu.org/onlinedocs/libgomp/Enabling-OpenMP.html). 

The compilation proceeds until we get to the source file mod_stokes.F (see below), and there the compiler decides that I have an error. I have compiled this code before for a pure MPI run with no issues, so clearly the fact it is now paying attention to the OpenMP pragmas is part of the problem.

I am unable to see any syntax error here, so I hope someone can see what I can't. 

The complaint is at column 72, but column 72 is fine. Line 637 is an !$OMP END PARALLEL DO statement, which starts at column 1. The entire loop this pragma brackets is commented out with 'c' comment tags. 

mpif90  -DIA32 -DREAL8 -DMPI -DENDIAN_IO -DTIMER -DARCTIC -DRELO -fPIC -fno-second-underscore -O2 -mavx -m64 -fdefault-real-8 -fdefault-double-8 -fopenmp -c mod_stokes.F
mod_stokes
.F:637:72:
 
!$OMP END PARALLEL DO
                                                                       
1
Error: Unexpected !$OMP END PARALLEL DO statement at (1)
mod_stokes
.F:655:72:
       call xctilr
(usd(    1-nbdy,1-nbdy,1),1,kk, 6,6, halo_uv)
                                                                       
1



alan.wa...@hycom.org

unread,
Feb 5, 2019, 1:24:28 PM2/5/19
to HYCOM.org Forum
mod_stokes isn't used unless the macro STOKES is set, but it is always compiled.  I should probably add an explicit dummy version to avoid the compile, but to answer your question the problem is that the OMP block is empty:

!$OMP PARALLEL DO PRIVATE(j,i,k)
!$OMP&         SCHEDULE(STATIC,jblk)
c
c                              Calculation of dzdx,dzdy needed in momtum
c                              -----------------------------------------


c         enddo  !j
c       enddo  !k


!$OMP END PARALLEL DO


This can be fixed by cementing out the !$OMP statements:

c!$OMP PARALLEL DO PRIVATE(j,i,k)
c!$OMP&         SCHEDULE(STATIC,jblk)

c!$OMP END PARALLEL DO

Alan.
Reply all
Reply to author
Forward
0 new messages