-1

I compile a code using CygWin/gfortran (gcc 7.4.0) and in one source it is showing the error:

gfortran -c -O2 -fopenmp   `FoX/FoX-config --fcflags`   -DGFORTRAN -DFC_HAVE_FLUSH -DFC_HAVE_ABORT           /home/gpkmo/siesta-4.0.2/Src/delk.F
/home/gpkmo/siesta-4.0.2/Src/delk.F:164:63:

 !$OMP   PARALLEL DEFAULT(NONE) SHARED(no,np,nvmax,iaorb,iphorb,
                                                               1
Error: Syntax error in OpenMP variable list at (1)
/home/gpkmo/siesta-4.0.2/Src/delk.F:165:6:

 !$   &    isa,numVs,listVsptr,listVs,dVol,maxloc,maxloc2,
      1
Error: Bad continuation line at (1)
/home/gpkmo/siesta-4.0.2/Src/delk.F:165:6:

 !$   &    isa,numVs,listVsptr,listVs,dVol,maxloc,maxloc2,
      1
Error: Unclassifiable statement at (1)
/home/gpkmo/siesta-4.0.2/Src/delk.F:598:72:

 !$OMP END PARALLEL
                                                                        1
Error: Unexpected !$OMP END PARALLEL statement at (1)
make: *** [arch.make:19: delk.o] Error 1

the problamatic source code portion is following:

   163  C     Allocate local memory
   164  !$OMP   PARALLEL DEFAULT(NONE) SHARED(no,np,nvmax,iaorb,iphorb,
   165  !$   &    isa,numVs,listVsptr,listVs,dVol,maxloc,maxloc2,
   166  !$   &    nvmaxl,triang,lenx,leny,lenxy,parallellocal,omp_ilc,
   167  !$   &    omp_ilocal,omp_iorb,omp_DscfL,omp_delkmats,omp_Clocal,
   168  !$   &    omp_Vlocal,
   169  !$   &    omp_phia,r2cut,indxuo,dxa,nsp,xdop,xdsp,NeedDscfL,listdl,
   170  !$   &    numdl,listdlptr,directphi,endpht,lstpht,listp2,phi,nodes,node)
   171  !$   &    PRIVATE(i,ia,ic,ii,ijl,il,imp,ind,iop,ip,iphi,is,isp,irealim,
   172  !$   &    iu,iul,ix,j,jc,jl,last,lasta,lastop,nc,nlocal,nphiloc,Vij,
   173  !$   &    r2sp,dxsp,VClocal,ilc,ilocal,iorb,DscfL,delkmats,Clocal,
   174  !$   &    Vlocal,
   175  !$   &    phia,nth,tid)
   176  #ifdef _OMP_
   177        NTH = omp_get_num_threads( )
   178        TID = omp_get_thread_num( ) + 1

Note that this code is working perfectly in Linux/gfortran! I have tried unix2dos as well as dos2unix tools for this delk.F but it doesnt help me.

francescalus
  • 30,576
  • 16
  • 61
  • 96
javaNEWbee
  • 21
  • 1
  • Possible duplicate of [Syntax for openmp long directive list fortran77](https://stackoverflow.com/questions/33704732/syntax-for-openmp-long-directive-list-fortran77) – francescalus Jul 08 '19 at 12:31

1 Answers1

0

In an OpenMP code that I wrote, the & character is at the end of the line and every line starts with !$OMP directive.

For your code, this would give:

   163  C     Allocate local memory
   164  !$OMP   PARALLEL DEFAULT(NONE) SHARED(no,np,nvmax,iaorb,iphorb, &
   165  !$OMP    isa,numVs,listVsptr,listVs,dVol,maxloc,maxloc2, &
   166  !$OMP    nvmaxl,triang,lenx,leny,lenxy,parallellocal,omp_ilc, &
   167  !$OMP    omp_ilocal,omp_iorb,omp_DscfL,omp_delkmats,omp_Clocal, &
   168  !$OMP    omp_Vlocal, &
   169  !$OMP    omp_phia,r2cut,indxuo,dxa,nsp,xdop,xdsp,NeedDscfL,listdl, &
   170  !$OMP    numdl,listdlptr,directphi,endpht,lstpht,listp2,phi,nodes,node) &
   171  !$OMP    PRIVATE(i,ia,ic,ii,ijl,il,imp,ind,iop,ip,iphi,is,isp,irealim, &
   172  !$OMP    iu,iul,ix,j,jc,jl,last,lasta,lastop,nc,nlocal,nphiloc,Vij, &
   173  !$OMP    r2sp,dxsp,VClocal,ilc,ilocal,iorb,DscfL,delkmats,Clocal, &
   174  !$OMP    Vlocal, &
   175  !$OMP    phia,nth,tid)
   176  #ifdef _OMP_
   177        NTH = omp_get_num_threads( )
   178        TID = omp_get_thread_num( ) + 1

This is only a tentative reply but the code is too long to post in a comment.

The syntax follows page 7 of the course by Nick Maclaren http://people.ds.cam.ac.uk/nmm1/openmp/paper_2.pdf

Pierre de Buyl
  • 7,074
  • 2
  • 16
  • 22