metno / emep-ctm

Open Source EMEP/MSC-W model
GNU General Public License v3.0
30 stars 20 forks source link

Code missing #49

Closed martinsaliba closed 5 years ago

martinsaliba commented 5 years ago

Dear EMEP Support,

I am new to EMEP model. The EMEP files were downloaded via the catalog.py tool. Then I tried to run the Base run simulation using the provided jobscript named modrun.sh

The links in the jobscript were updated in order to match the path of the input files. However, it was noticed that my download is missing the crucial part of the EMEP code. In fact, in my EMEP directory I can't find the following directory: /code/Unimod

Without the model code I can't run a simulation. Any guidance on how to get the source code for the directory: /code/Unimod

Your guidance is highly appreciated.

Regards Martin

modrun

EMEP_directory EMEP_path

avaldebe commented 5 years ago

Hi @martinsaliba

Looks like you are working trying to run the EECCA/20lev example from rv4_15.

I do not know your expertise level on a GNU Linux system, and hope my answer was understandable. Please let me know if you need more help.

martinsaliba commented 5 years ago

Hi,

Thanks for getting back. The missing directory is due to the fact that the EMEP code was not compiled. I tired to compile with the make command. But I got some errors as described below:

[wrfchem@grid emep-ctm-rv4_15]$ make
mpif90 -shared-intel -r8 -recursive -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c PhysicalConstants_ml.f90
gfortran: error: unrecognized command line option ‘-shared-intel’
gfortran: error: unrecognized command line option ‘-r8’
gfortran: error: unrecognized command line option ‘-recursive’
make: *** [PhysicalConstants_ml.o] Error 1

It seems that the error is related to the compiler. Because our cluster has default the GCC while the EMEP use Intel. The following shows the setup of our ggc compiler:

[wrfchem@grid emep-ctm-rv4_15]$ which ggc
/usr/bin/which: no ggc in (/cm/shared/apps/qhull/2012.1/bin:/cm/shared/apps/fftw/gcc/64/3.3.4/bin:/cm/shared/apps/qt/5.0.2/bin:/cm/shared/apps/python/2.7.11/bin:/cm/shared/apps/hdf5/1.10.0/gcc/mpi/bin:/cm/shared/apps/ncview/gcc/2.1.7/bin:/cm/shared/apps/jags/gcc/4.2.0/bin:/cm/shared/apps/java/jdk1.8.0_25/bin:/cm/shared/apps/gnu-libraries/gcc-4.8.5/bin:/cm/shared/apps/r/gcc/64/3.3.2/bin:/cm/shared/apps/gsl/2.1/gcc/bin:/cm/shared/apps/nco/gcc/4.6.9/bin:/cm/shared/apps/ncl/gcc/6.2.0/bin:/cm/shared/apps/proj/gcc/4.9.2/bin:/cm/shared/apps/ncl/gcc/6.2.0/bin:/cm/shared/apps/curl/7.42.1/bin:/cm/shared/apps/hdf5/1.8.18/gcc/mpi/bin:/cm/shared/apps/mpich2/3.2/gcc/bin:/cm/shared/apps/x11/1.3.4/gcc/bin:/cm/shared/apps/glib/2.42.1/bin:/cm/shared/apps/gcc/4.8.5/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/NX/bin:/cm/shared/apps/sge/current/bin/linux-x64:/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/bin/:/home/wrfchem/ANTHRO/src:/home/wrfchem/processor:/home/wrfchem/bio_emiss:/home/wrfchem/mozbc:/cm/shared/apps/netcdf/gcc/64/4.4.1/mpi/bin/:/home/wrfchem/bin)

Is it possible to modify the makefile in order to compile EMEP with ggc?

Your guidance is much appreciated

Regards Martin

PS: Below is the makefile command:

PROG =  Unimod
###################################################

include Makefile.SRCS

###################################################

# prefered netCDF 4.2.1.1 or later
LIBS = -lnetcdff -lnetcdf
INCL = -I/global/apps/netcdf/4.1.3/include
LLIB = -L/global/apps/netcdf/4.1.3/lib

# options by nc-config/nf-config utility
INCL = $(shell nc-config --fflags)
LLIB = $(shell nc-config --flibs)

F90 = mpif90

# GNU gfortran compiler (version 4.4.3 or later)
F90FLAGS = -ffree-line-length-none -fdefault-real-8 -O3

# Intel ifort compiler
F90FLAGS = -shared-intel -r8 -recursive -O3

###################################################

LDFLAGS = $(F90FLAGS) $(LLIB) -o $(PROG) $(FOBJ) $(INCL) $(LIBS)

.SUFFIXES: $(SUFFIXES)  .f90

.f90.o:
    $(F90) $(F90FLAGS) $(INCL) -c $<

all:  $(PROG)

# Include the dependency-list (created by makedepf90)
include dependencies

$(PROG): $(FOBJ)
     $(F90) $(LDFLAGS)
#

clean: diskclean

diskclean:
    rm -f $(PROG) *.o *.mod

##########################################################
avaldebe commented 5 years ago

Hi @martinsaliba

The EMEP/MSC-W model is written in Fortran. gcc is a C/C++ compiler, you probably want to compile with gfortran. I suspect that ggc is a typo on your previous message, please update it.

The Makefile includes flags for gfortran (GNU Fortran compiler) and ifort (Intel ifort compiler). To compile with gfortran comment the ifort flags as in the following lines:

# GNU gfortran compiler (version 4.4.3 or later)
F90FLAGS = -ffree-line-length-none -fdefault-real-8 -O3

# Intel ifort compiler
#F90FLAGS = -shared-intel -r8 -recursive -O3

To successfully compile the model you will also need a NetCDF and MPI libraries, see computer requirements. Those are likely to be available in your cluster via module load. ask your cluster support team which module(s) to load.

martinsaliba commented 5 years ago

Hi,

The intel compiler was deactivated as instructed with the # symbol. However, when I tried to compile the EMEP code rv4.15, the following error was encountered:

[wrfchem@grid emep-ctm-rv4_15]$ make
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c CM_ChemRates_ml.f90
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

The same procedure was applied when I tried to compile the rv4.17. The following error was encountered:

[wrfchem@grid emep-ctm-rv4_17]$ make
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c PhysicalConstants_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c AeroFunctions.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c SmallUtils_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c Precision_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c NumberConstants.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c OwnDataTypes_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c Io_Nums_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c CM_ChemSpecs_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c ChemSpecs_wrapper.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c MPI_Groups_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c CheckStop_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c Config_module.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c Aero_Vds_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c Setup_1dfields_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c Ammonium_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c Par_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c MetFields_ml.f90
MetFields_ml.f90:961.22:

  do n = 1, Nspecial2d
                      1
Warning: DO loop at (1) will be executed zero times
MetFields_ml.f90:983.22:

  do n = 1, Nspecial3d
                      1
Warning: DO loop at (1) will be executed zero times
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c InterpolationRoutines_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c TimeDate_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c TimeDate_ExtraUtil_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c Functions_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c GridValues_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c CM_ChemGroups_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c AllocInit.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c ChemFields_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c AOD_PM_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c KeyValueTypes.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c Io_Progs_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c Io_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c Country_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c My_Pollen_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c Units_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c DerivedFields_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c My_Outputs_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c NetCDF_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c MicroMet_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c LandPFT_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c LandDefs_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c GridAllocate_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c LocalVariables_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c DO3SE_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c Landuse_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c Radiation_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c DefPhotolysis_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c FastJ_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c BLPhysics_ml.f90
mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c Met_ml.f90
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

Any guidance how to solve the compilation issue?

Regards Martin

avaldebe commented 5 years ago

These are known gfortran issues, see the discussion on #43 for details on how to fix them. This issues should be fixed on the next release, which is planed for the next month. Alas, this is all I can write now. Please have a look at #43 and ask for what you do no understand.

rosagierens commented 5 years ago

You could also check #38 for gfrotran issues

martinsaliba commented 5 years ago

Hi @avaldebe

I am now focusing on the compilation of rv4_17. The cluster administrator provided the correct paths of the Netcdf libraries. The links were updated in the Makefile located in the emep-ctm-rv4_17 directory. However, when started compiling the code with the make command, I got the following error:

mpif90 -ffree-line-length-none -fdefault-real-8 -O3 -I/cm/shared/apps/netcdf/gcc/64/4.4.0/mpi/include -c Met_ml.f90
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

This error is already described in the post #43. But I can't understand the explanation to solve this issue.

NOTE: It disappears when substituting the logical sentences

Which line is located this logical sentence? What is the substitution of the logical sentence?

I am using the nano command to view the code of the Met_ml.f90 file The command is nano Met_ml.f90

It seems this is the last issue I have to compile the EMEP source code. Therefore, some more detailed explanation on how to solve this issue will be appreciated.

martinsaliba commented 5 years ago

Some of the issues were corrected as described on #38. However, I still have a problem how to update the files CellMet_ml.f90 and ColumnSource_ml.f90. I will keep posting on the issue in #38

avaldebe commented 5 years ago

Hi @martinsaliba

As you are now focusing on rv4_17, you can use the source code in our repository. On the last commit to the source branch (d60dd09) implemented all the fixes. The following command will retrieve the code from the source branch and put it on a new directory (emep-ctm/)

git clone -b source --single-branch git@github.com:metno/emep-ctm.git
martinsaliba commented 5 years ago

Hi

Just tried to download the corrected source code. But got fatal error due to public key issues. Any guidance on this matter?

martin@MARTIN-PC:~/Models/EMEP$ git clone -b source --single-branch git@github.com:metno/emep-ctm.git
Cloning into 'emep-ctm'...
The authenticity of host 'github.com (140.82.118.3)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'github.com,140.82.118.3' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
avaldebe commented 5 years ago

Looks like you have not set up your ssh keys to access GitHub. Adding a new ssh key to your github account describes the process.

In any case, you do not need to set up your keys to download the code. Use the following command instead:

git clone -b source --single-branch https://github.com/metno/emep-ctm.git