lanl / LaGriT

Los Alamos Grid Toolbox (LaGriT) is a library of user callable tools that provide mesh generation, mesh optimization and dynamic mesh maintenance in two and three dimensions.
https://lanl.github.io/LaGriT/
Other
116 stars 48 forks source link

Error: Symbol 'itp1' at (1) already has basic type of INTEGER #166

Closed daniellivingston closed 5 years ago

daniellivingston commented 5 years ago

When compiling LaGriT, dumpexodusII.f throws the following error:

gfortran -fcray-pointer -fdefault-integer-8 -m64 -arch x86_64 -Dmacx64 -O -I/Users/UserName/Documents/GitHub/LaGriT/seacas/lib/../include -cpp -c -o objects/dumpexodusII.o dumpexodusII.f
dumpexodusII.f:259:21:

  259 |       integer itp1(*)
      |                     1
Error: Symbol 'itp1' at (1) already has basic type of INTEGER
make[1]: *** [objects/dumpexodusII.o] Error 1
make: *** [before] Error 2

It appears that this is a unique issue with GCC 9.x compilers.

daniellivingston commented 5 years ago

Fixed in c75759ce12752bad58e9d7cdf386484b2854f46f. The variable itp1 was defined twice – first as an integer of rank 0 (line 179), then as an unallocated integer array (line 259). Removing the line 179 definition fixes the compilation error. All tests pass and Exodus output is as expected.

179: integer iunit, iflag, ncount, ival, ival2, itp1 <-- defined first here
258: pointer (ipitp1, itp1)
259: integer itp1(*) <-- defined again here

547: call cmo_get_info('itp1',cmo_name,ipitp1,lout,itype,ierr)
1688:call pntlimc(cpt1,cpt2,cpt3,ippmpary1,mpno,
                *          nnodes,isetwd,itp1)
daniellivingston commented 5 years ago

Travis first caught this error here, but now passes.