-assume noold_ldout_format for GNU

Dominique d'Humières dominiq@lps.ens.fr
Wed May 30 13:35:00 GMT 2018



> 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



More information about the Fortran mailing list