public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: nachiket k <nachiket316@gmail.com>
To: "Dominique d'Humières" <dominiq@lps.ens.fr>
Cc: gfortran <fortran@gcc.gnu.org>
Subject: Re: -assume noold_ldout_format for GNU
Date: Thu, 31 May 2018 08:06:00 -0000	[thread overview]
Message-ID: <CAAsAziCYnuQOr0yCf3e2WPou5cjJ7o9V7MVipEnAdBrKcyukdg@mail.gmail.com> (raw)
In-Reply-To: <9ADB1785-4C88-494B-A37A-757A8F6AE640@lps.ens.fr>

Hi,

I removed all the flags

I recompiled g2

There is this line in the code
integer(4) :: ire00,allones

allones=Z'FFFFFFFF'

So here overflow error occurs integer(16) to integer(4)

I tried allones=Z'FF'
and
integer(16) :: allones
allones=Z'FFFFFFFF'


Doing any of these compiles the code
-Wall gives following warning

In pngpack.f,jpcpack.f
real(8) to real(4)
rmin4 = rmin
this is because of their declaration as

real(4) :: rmin4
real(8) :: rmin

and

intmath.f:212.17:

         ilog2_1=ilog2_1+4
                 1
Warning: Possible change of value in conversion from INTEGER(4) to
INTEGER(1) at (1)



As all of these are warning compilation is completed

but in copygb2 I still face issue

copygb2.f:1072.35:

          CALL INTGRIB2(0,IP,IPOPT,d,nopt,opt,KGDSB,
                                   1
Warning: Type mismatch in argument 'ngdt1' at (1); passed REAL(4) to
INTEGER(4)
copygb2.f:776.20:

          CALL CPGB1(LG1,LX1,M1,
                    1
Error: Dummy argument 'kgdti' of procedure 'cpgb1' at (1) has an attribute
that requires an explicit interface for this procedure
make: *** [copygb2.o] Error 1

Is a lot of source code change needed here ? of is there any flag that can
take care of this issue ?


On Wed, May 30, 2018 at 7:05 PM, Dominique d'Humières <dominiq@lps.ens.fr>
wrote:

>
>
> > Le 30 mai 2018 à 14:56, nachiket k <nachiket316@gmail.com> a écrit :
> >
> > Hi,
> > without -fdefault-real-8
> > we get following errors
> >
> > cpgb.f:446:72:
> >
> >       &                IB1I,L1I,F1I,G1I,IRET)
> >                                                                         1
> > Error: Type mismatch in argument ‘f1’ at (1); passed REAL(8) to REAL(4)
>
> You must compile ALL the files in the project without -f*-real-8.
>
> > cpgb.f:482:72:
> >
> >       &       KB,IBB,LR,FR,GR,d,KGDTI,MI,IBBI,LBI,FBI,GBI,IRET)
> >                                                                         1
> > Error: Type mismatch in argument ‘ngdt1’ at (1); passed REAL(4) to
> INTEGER(4)
>
> I don’t know where the module GRIDTEMPLATES is defined. AFAICT ‘ngdt1’ is
> supposed to be an INTEGER (implicitly defined in cpgb.f).
>
> CALL INTGRIB2(0,IP,IPOPT,d,…
>
> looks suspicious if ‘d’ is not explicitly defined as an INTEGER.
>
> > cpgb.f:600:72:
> >
> >       &                    IBBI,LBI,FBI,GBI,IRET)
> >                                                                         1
> > Error: Type mismatch in argument ‘f1’ at (1); passed REAL(8) to REAL(4)
> > cpgb.f:655:8:
> >
> >          GFLD1%FLD => F1I
> >         1
> > Error: Different types in pointer assignment at (1); attempted
> assignment of REAL(4) to REAL(8)
> > cpgb.f:662:10:
> >
> >            GFLD1%FLD => G1I
> >           1
> > Error: Different types in pointer assignment at (1); attempted
> assignment of REAL(4) to REAL(8)
> > cpgb.f:692:31:
> >
> >        IF (ASSOCIATED(GFLD1%FLD,G1I)) then
> >                                1
> > Error: ‘target’ argument of ‘associated’ intrinsic at (1) must be the
> same type and kind as ‘pointer’
>
> I think all the above errors are due to the use of -f*-real-8 when
> compiling other files (see above).
>
> > This is the path to the source code of file I am trying to install
> >
> > www.nco.ncep.noaa.gov/pmb/codes/nwprod/grib_util.v1.0.5/
> sorc/copygb2.fd/copygb2.f
> >
> > This is the parent directory
> > www.nco.ncep.noaa.gov/pmb/codes/nwprod/grib_util.v1.0.5/sorc/copygb2.fd/
> >
> > As there is dependency on many other libraries I am not sure how to
> create a reduced code for this issue.
> >
> > (PS without using -fdefault-real-8 even the dependency library g2 is not
> getting installed which has -r8 -i4 also had to uses
> > -fno-range-check)
> > without -fno-range-check
> > I get
> > gfortran -c -O3 -g  -fdefault-real-8 -J../include/g2_v3.1.0_d addfield.f
> > addfield.f:122:14:
> >
> >        allones=Z'FFFFFFFF'
> >               1
> > Error: Arithmetic overflow converting INTEGER(16) to INTEGER(4) at (1).
> This check can be disabled with the option ‘-fno-range-check’
> > make: *** [../libg2_v3.1.0_d.a(addfield.o)] Error 1
>
> Not related to -fdefault-real-8. Look at the manual for BOZ behavior in
> gfortran.
>
> > Source of g2 library is
> > http://www.nco.ncep.noaa.gov/pmb/codes/nwprod/lib/g2/v3.1.0/
> >
> > Sorry for inconvenience
> >
> > Thanks and Regards,
> > Nachiket
>
> Dominique
>
>

  reply	other threads:[~2018-05-31  8:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-30 12:23 Dominique d'Humières
2018-05-30 12:56 ` nachiket k
2018-05-30 13:35   ` Dominique d'Humières
2018-05-31  8:06     ` nachiket k [this message]
2018-05-31 13:34       ` Dominique d'Humières
2018-05-31 15:12       ` Steve Kargl
  -- strict thread matches above, loose matches on Subject: below --
2018-05-28 11:24 nachiket k
2018-05-28 15:38 ` Steve Kargl
2018-05-29  6:05   ` nachiket k
2018-05-29 16:35     ` Steve Kargl
2018-05-30  9:55       ` nachiket k
2018-05-30 11:43         ` Martin Tee via fortran
2018-05-30 12:05           ` nachiket k

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAsAziCYnuQOr0yCf3e2WPou5cjJ7o9V7MVipEnAdBrKcyukdg@mail.gmail.com \
    --to=nachiket316@gmail.com \
    --cc=dominiq@lps.ens.fr \
    --cc=fortran@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).