Hello everyone,
I have a similar problem with MEGAN, could you solve it? let me know please.
My problem is that when I try to execute make_util megan_bio_emiss the executable is not generated. My error is as follows:
=============================================================================
Using gfortran fortran compiler
=============================================================================
=============================================================================
netcdf top level directory = /home/guido/Build_WRF/LIBRARIES/netcdf
=============================================================================
gfortran -g -ffree-line-length-none -c -I/home/guido/Build_WRF/LIBRARIES/netcdf/include misc_definitions_module.f90
gfortran -g -ffree-line-length-none -c -I/home/guido/Build_WRF/LIBRARIES/netcdf/include constants_module.f90
gfortran -g -ffree-line-length-none -c -I/home/guido/Build_WRF/LIBRARIES/netcdf/include bio_types.f90
gfortran -g -ffree-line-length-none -c -I/home/guido/Build_WRF/LIBRARIES/netcdf/include area_mapper.f90
gfortran -g -ffree-line-length-none -c -I/home/guido/Build_WRF/LIBRARIES/netcdf/include bio_emiss.f90
gfortran -o megan_bio_emiss misc_definitions_module.o constants_module.o bio_types.o area_mapper.o bio_emiss.o -L/home/guido/Build_WRF/LIBRARIES/netcdf/lib -lnetcdf -lnetcdff
/home/guido/Build_WRF/LIBRARIES/netcdf/lib/libnetcdff.a(fort-attio.o): In function `nf_put_att_text_':
/home/guido/Build_WRF/LIBRARIES/netcdf-4.1.3/fortran/fort-attio.c:14: undefined reference to `nc_put_att_text'
/home/guido/Build_WRF/LIBRARIES/netcdf/lib/libnetcdff.a(fort-attio.o): In function `nf_get_att_text_':
/home/guido/Build_WRF/LIBRARIES/netcdf-4.1.3/fortran/fort-attio.c:21: undefined reference to `nc_get_att_text'
//
//
/home/guido/Build_WRF/LIBRARIES/netcdf/lib/libnetcdff.a(fort-lib.o): In function `f2c_counts':
/home/guido/Build_WRF/LIBRARIES/netcdf-4.1.3/fortran/fort-lib.c:116: undefined reference to `nc_inq_varndims'
/home/guido/Build_WRF/LIBRARIES/netcdf/lib/libnetcdff.a(fort-lib.o):/home/guido/Build_WRF/LIBRARIES/netcdf-4.1.3/fortran/fort-lib.c:138: more undefined references to `nc_inq_varndims' follow
/home/guido/Build_WRF/LIBRARIES/netcdf/lib/libnetcdff.a(fort-misc.o): In function `nf_inq_libvers_':
/home/guido/Build_WRF/LIBRARIES/netcdf-4.1.3/fortran/fort-misc.c:20: undefined reference to `nc_inq_libvers'
//
//
/home/guido/Build_WRF/LIBRARIES/netcdf/lib/libnetcdff.a(fort-varaio.o): In function `nf_put_vara_':
/home/guido/Build_WRF/LIBRARIES/netcdf-4.1.3/fortran/fort-varaio.c:160: undefined reference to `nc_put_vara'
/home/guido/Build_WRF/LIBRARIES/netcdf/lib/libnetcdff.a(fort-varaio.o): In function `nf_get_vara_':
/home/guido/Build_WRF/LIBRARIES/netcdf-4.1.3/fortran/fort-varaio.c:163: undefined reference to `nc_get_vara'
collect2: error: ld returned 1 exit status
Makefile:45: recipe for target 'megan_bio_emiss' failed
make: *** [megan_bio_emiss] Error 1
Failed to build megan_bio_emiss
I installed netcdf using the manual compiling wrf (with precompiled code netcdf-4.1.3).
I have netcdf library installed on the correct path, I do not understand what the problem is with the library.
Could someone please help me?
This is my .tcshrc here my set environmental:
############# NCL variables #################
setenv NCARG_ROOT /usr/local/ncl-6.3.0
setenv PATH $NCARG_ROOT/bin:$PATH
################### NETCDF #########################
setenv LD_LIBRARY_PATH
setenv LD_LIBRARY_PATH /home/guido/Build_WRF/LIBRARIES/netcdf/lib:LD_LIBRARY_PATH
############# HDF5 variables #################
setenv HDF5_LIBS /usr/lib/x86_64-linux-gnu
setenv LD_LIBRARY_PATH
setenv LD_LIBRARY_PATH /usr/local/hdf5-1.10.1/hdf5/lib:$LD_LIBRARY_PATH
#######################################################
####### Set environment variables for NetCDF #######
setenv DIR /home/guido/Build_WRF/LIBRARIES
setenv CC gcc
setenv CXX g++
setenv FC gfortran
setenv FCFLAGS -m64
setenv F77 gfortran
setenv F90 gfortran
setenv FFLAGS -m64
setenv PATH $DIR/netcdf/bin:$PATH
setenv NETCDF $DIR/netcdf
setenv NETCDF_DIR $DIR/netcdf
#######################################################
####### Set environment variables for Mpich #######
# This library is necessary to build WRF in parallel
setenv PATH $DIR/mpich/bin:$PATH
#######################################################
### Set environment variables for zlib, libpng, and JasPer ###
# A compression library necessary for compiling WPS
# (specifically ungrib) with GRIB2 capability
setenv LDFLAGS -L$DIR/grib2/lib
setenv CPPFLAGS -I$DIR/grib2/include
#######################################################
####### Set environment variables for JasPer ######
setenv JASPERLIB $DIR/grib2/lib
setenv JASPERINC $DIR/grib2/include
#######################################################
######## Set environment variables for WRF ########
setenv WRFIO_NCD_LARGE_FILE_SUPPORT 1
#######################################################
##### Set environment variables for WRF-Chem ######
setenv WRF_EM_CORE 1
setenv EM_CORE 1
setenv NMM_CORE 0
setenv WRF_CHEM 1
setenv WRF_KPP 0
setenv YACC '/usr/bin/yacc -d'
setenv FLEX_LIB_DIR /usr/lib/x86_64-linux-gnu
setenv PATH /usr/lib:$PATH
Best,
Guido