Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error compiling EMEP_MSC_W with gfortran. #43

Closed
JessMBemep opened this issue Oct 11, 2018 · 12 comments
Closed

Error compiling EMEP_MSC_W with gfortran. #43

JessMBemep opened this issue Oct 11, 2018 · 12 comments

Comments

@JessMBemep
Copy link

Hi,
I am trying to compile EMEP_MSC_W. I already downloaded the code sources, the complementary data and tools. But some bugs arise when compiling. See detailed description bellow.
I see that you solved a similar issue in june 2018: #38
It seems you solved it in an specific dev version. Could you please indicate me what is the version (github path) that I have to download?
(I'm currently compiling OpenSource rv4.17 (201802))
Many thanks in advance
Best regards

Jessie

  1. Met_ml.f90:3117.5:

if(met(ix)%found == .false.) then
1
Error: Logicals at (1) must be compared with .eqv. instead of ==
make: *** [Met_ml.o] Error 1

NOTE: It disappears when substituting the logical sentences

  1. EmisDef_ml.f90:104.56:

    integer, save, dimension(NSECTORS_SNAP,3) ::snap2gnfr=(/1,3,2,4,13,5,6,7,10,
    1
    Error: Incompatible ranks 2 and 1 in assignment at (1)
    make: *** [EmisDef_ml.o] Error 1

NOTE: It disappears when uncomment line 103 and comment 104
! integer, save, dimension(NSECTORS_SNAP) ::snap2gnfr=(/1,3,2,4,13,5,6,7,10,11,-1/)

  1. CellMet_ml.f90:212.14:

        if(z0_out_ix) d_2d(z0_out_ix,i,j,IOU_INST) = &
           1
    

Error: IF clause at (1) requires a scalar LOGICAL expression
CellMet_ml.f90:221.14:

       if(z0_out_ix) d_2d(z0_out_ix,i,j,IOU_INST) = &
          1

Error: IF clause at (1) requires a scalar LOGICAL expression
make: *** [CellMet_ml.o] Error 1

NOTE: From: https://oss.deltares.nl/web/xbeach/forum/-/message_boards/message/456419
Some compilers (intel) support if statements with integers, some (gfortran) don't. In this case someone was probably using the intel compiler and not aware that using integers as logicals is an intel specific extension. I updated the code in subversion.
line 212: if(z0_out_ix == 1)
line 221: if(z0_out_ix == 1)

  1. CM_ChemRates_ml.f90:137.32:

    rct(68,:) = 1450000000000*exp(-10688*TINV)
                             1
    

Error: Integer too big for its kind at (1). This check can be disabled with the option -fno-range-check
make: *** [CM_ChemRates_ml.o] Error 1

@avaldebe
Copy link
Collaborator

Hi @JessMBemep
As you wrote some of this issues are solved on our development/research code,
so I am confident that they wont show up on our next model release.

In the meantime, I'll implement the changes needed to compile on gfortran 5.4.0 and push them to the code branch and will comment again when this is ready.

avaldebe added a commit that referenced this issue Oct 11, 2018
@avaldebe
Copy link
Collaborator

Hi again,
Just pushed the changes. You need to go to the source branch and get the code from there.
Please close the issue if this solves your problems.

Cheers,
Á.

@JessMBemep
Copy link
Author

JessMBemep commented Oct 11, 2018 via email

@avaldebe
Copy link
Collaborator

Just pushed the changes. You need to go to the source branch and get the code from there.

Alternatively, you can clone the branch with the following command:

git clone git@github.com:metno/emep-ctm.git --branch source --single-branch rv4_17_gfortran

@JessMBemep
Copy link
Author

It works :-)
Thanks a lot

@fipoucat
Copy link

fipoucat commented Feb 3, 2019

I was compiling with gfortran and was getting error then see this post.

Itried to clone the program as suggested here but not working 👍
git clone git@github.com:metno/emep-ctm.git --branch source --single-branch rv4_17_gfortran

with the following:

inclonsistancey between the host name and certificate
requ^ete HTTP request on queue no response...404 Not Found
2019-02-03 15:30:50 ERREUR 404: Not Found.

@gitpeterwind
Copy link
Member

Don't know what is wrong here. For the time being, you could download an exact copy from my private repository:
git clone https://github.com/gitpeterwind/emep-ctm.git --branch source --single-branch rv4_17_gfortran

@gitpeterwind
Copy link
Member

or perhaps try also with
git clone https://github.com/metno/emep-ctm.git --branch source --single-branch rv4_17_gfortran

@fipoucat
Copy link

fipoucat commented Feb 3, 2019

I cloned now but still get error: looks mismatch somewhere

mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I//anaconda/include -c MPI_Groups_ml.f90
MPI_Groups_ml.f90:29:4:

 use mpi,only: MPI_REAL8,MPI_DOUBLE_PRECISION,MPI_DOUBLE_COMPLEX,&
    1
Fatal Error: Cannot read module file 'mpi.mod' opened at (1), because it was created by a different version of GNU Fortran
compilation terminated.
make: *** [MPI_Groups_ml.o] Error 1

@gitpeterwind
Copy link
Member

it seems that you have compiled the MPI library with a different compiler version

@fipoucat
Copy link

fipoucat commented Feb 3, 2019

Manage to set the path to mpif90 but complain about netcdf:

mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I//anaconda/include -c PhysicalConstants_ml.f90
gfortran: warning: couldn’t understand kern.osversion ‘18.2.0
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I//anaconda/include -c AeroFunctions.f90
gfortran: warning: couldn’t understand kern.osversion ‘18.2.0
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I//anaconda/include -c SmallUtils_ml.f90
gfortran: warning: couldn’t understand kern.osversion ‘18.2.0
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I//anaconda/include -c Precision_ml.f90
gfortran: warning: couldn’t understand kern.osversion ‘18.2.0
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I//anaconda/include -c NumberConstants.f90
gfortran: warning: couldn’t understand kern.osversion ‘18.2.0
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I//anaconda/include -c OwnDataTypes_ml.f90
gfortran: warning: couldn’t understand kern.osversion ‘18.2.0
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I//anaconda/include -c Io_Nums_ml.f90
gfortran: warning: couldn’t understand kern.osversion ‘18.2.0
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I//anaconda/include -c CM_ChemSpecs_ml.f90
gfortran: warning: couldn’t understand kern.osversion ‘18.2.0
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I//anaconda/include -c ChemSpecs_wrapper.f90
gfortran: warning: couldn’t understand kern.osversion ‘18.2.0
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I//anaconda/include -c MPI_Groups_ml.f90
gfortran: warning: couldn’t understand kern.osversion ‘18.2.0
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I//anaconda/include -c CheckStop_ml.f90
gfortran: warning: couldn’t understand kern.osversion ‘18.2.0
CheckStop_ml.f90:41.4:

use netcdf, only: NF90_NOERR,NF90_STRERROR
    1
Fatal Error: File 'netcdf.mod' opened at (1) is not a GNU Fortran module file
make: *** [CheckStop_ml.o] Error 1

@fipoucat
Copy link

fipoucat commented Feb 3, 2019

it looks an os problem, I am using OSX and maybe someone who compiled a such systems could help

@avaldebe avaldebe mentioned this issue Mar 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants