error in pnetcdf.inc
Wei-keng Liao
wkliao at eecs.northwestern.edu
Fri Jun 5 08:34:24 CDT 2015
If I remove the modifier "_8", then gfortran failed to compile.
Here is the test program I used.
% cat big_constants.f
program Test
implicit none
integer*8 nf_fill_uint
parameter (nf_fill_uint = 4294967295)
end
% gfortran big_constants.f
big_constants.f:4.42:
parameter (nf_fill_uint = 4294967295)
1
Error: Integer too big for its kind at (1). This check can be disabled with the option -fno-range-check
(Compiling the same above program with pgf77 is fine.)
Wei-keng
On Jun 5, 2015, at 7:31 AM, Jim Edwards wrote:
> The construct _I8 is part of the f90 standard and not f77. I think that for f77 compliance you would need to remove this modifier and set the constant without it.
>
> On Fri, Jun 5, 2015 at 3:17 AM, Wei-keng Liao <wkliao at eecs.northwestern.edu> wrote:
> Hi, Jim
>
> Sorry for replying your email this late.
>
> I honestly do not have a good solution for this.
> If I removed the trailing underscore and 8, then the F77 program,
> pnf_test.f, is compiled fine with pg77 but failed with gfortran.
>
> Adding "-fno-range-check" flag to gfortran command line passed
> the compilation, but I don't think I should enforce this option for gfortran.
>
> On the other hand, pgf77 does not appear to understand the trailing suffix "_8".
>
> I am open to any suggestion.
>
> Wei-keng
>
> On Jun 2, 2015, at 12:25 PM, Jim Edwards wrote:
>
> > Sorry - I was wrong _I8 still gives an error. The problem is that you are compiling an f90 test with f77 :
> >
> > /usr/mpi/pgi/mvapich2-1.8.1-qlc/bin/mpif77 -c -g -I../../src/lib -I../../src/libf -I../../src/libf90 pnf_test.f
> >
> > PGFTN-S-0034-Syntax error at or near identifier _8 (../../src/libf/pnetcdf.inc: 79)
> >
> > PGFTN-S-0034-Syntax error at or near identifier _8 (../../src/libf/pnetcdf.inc: 80)
> >
> > PGFTN-S-0034-Syntax error at or near ( (pnf_test.f: 51)
> >
> > PGFTN-S-0034-Syntax error at or near ( (pnf_test.f: 64)
> >
> > PGFTN-S-0034-Syntax error at or near ( (pnf_test.f: 65)
> >
> > PGFTN-S-0034-Syntax error at or near ( (pnf_test.f: 69)
> >
> >
> >
> > switching this to use f90 solves the problem.
> >
> >
> >
> >
> > On Tue, Jun 2, 2015 at 10:28 AM, Jim Edwards <jedwards at ucar.edu> wrote:
> > Building pnetcdf1.6.1 using the pgi 15.1 compiler gives an error at lines 54 and 55 of pnetcdf.inc. The compiler did not like:
> > parameter (nf_fill_uint = 4294967295_8)
> > parameter (nf_fill_int64 = -9223372036854775806_8)
> >
> > I changed it to:
> >
> > parameter (nf_fill_uint = 4294967295_I8)
> > parameter (nf_fill_int64 = -9223372036854775806_I8)
> >
> >
> >
> >
> >
> > --
> > Jim Edwards
> >
> > CESM Software Engineer
> > National Center for Atmospheric Research
> > Boulder, CO
> >
> >
> >
> > --
> > Jim Edwards
> >
> > CESM Software Engineer
> > National Center for Atmospheric Research
> > Boulder, CO
>
>
>
>
> --
> Jim Edwards
>
> CESM Software Engineer
> National Center for Atmospheric Research
> Boulder, CO
More information about the parallel-netcdf
mailing list