user3410308
user3410308

Reputation: 1

*** No rule to make target `module_netcdf_io.o', needed by `driver.exe'. Stop. Error

I am trying to run make on Noah-MP.

However, I keep getting this error. (*** No rule to make target module_netcdf_io.o', needed bydriver.exe'. Stop.)

This is the makefile:

.SUFFIXES:
.SUFFIXES: .o .F

include user_build_options

OBJS =  module_sf_noahmplsm.o \
    module_model_constants.o \
    module_sf_myjsfc.o \
    module_sf_sfclay.o \
    module_sf_noahlsm.o \
    module_ascii_io.o \
    module_netcdf_io.o \
    module_io.o \
    kwm_date_utilities.o \
    module_sf_noahutl.o \
    driver.o

CMD = driver.exe

FFLAGS =    $(FREESOURCE) $(F90FLAGS)

all:    $(CMD)

driver.exe: $(OBJS)
    $(COMPILERF90) -o $(@) $(OBJS) $(NETCDFLIB)

.F.o:
    $(RM) $(*).f90
    $(CPP) $(CPPMACROS) $(NETCDFINC) $(*).F > $(*).f90
    $(COMPILERF90) -c $(FFLAGS) $(NETCDFINC) $(*).f90
    $(RM) $(*).f90

clean:
    $(RM) $(OBJS) $(CMD) *.mod *~

driver.exe:     driver.o
driver.exe:     module_sf_noahmplsm.o
driver.exe:     module_sf_noahutl.o
driver.exe:     module_io.o
module_io.o:        module_ascii_io.o
module_io.o:        module_netcdf_io.o
module_ascii_io.o:  kwm_date_utilities.o
module_sf_noahmplsm.o:  module_sf_myjsfc.o module_sf_sfclay.o module_sf_noahlsm.o
module_sf_myjsfc.o: module_model_constants.o

The folder contains the following files:

graphics
bondville.dat
bondville.val
driver.F
GENPARM.TBL
kwm_date_utilities.F
Makefile
module_ascii_io.F
module_io.F
module_model_constants.F
module_netcdf_io.F
module_sf_myjsfc.F
module_sf_noahlsm.F
module_sf_noahmplsm.F
module_sf_noahutl.F
module_sf_sfclay.F
MPTABLE.TBL
README
SOILPARM.TBL
user_build_options
VEGPARM.TBL

The user_build-options, which is required to link the file with the netcdf directories reads like this:

#
#  Options for Linux with Intel Fortran
#

# COMPILERF90   =   ifort
# FREESOURCE    =   -free
# CPPMACROS =   -D_SIMPLE_DRIVER_
# F90FLAGS  =       -convert big_endian -g -O0 -check all,noshape,nopointer,noarg_temp_created -fp-model precise -fpe0 #-fp-model strict
# CPP       =   cpp -C -P -traditional 
# LIBS      =
# NETCDFDIR =   /home/tirtha/libs/netcdf/
# NETCDFINC =   /home/tirtha/libs/netcdf/include/
# NETCDFLIB =   /home/tirtha/libs/netcdf/lib/
# NCARG_ROOT    =   /home/tirtha/NCARG/ncl6.1/
# RM        =   rm -f
# CC        =   cc

I have removed the hash tags before running the code.

Upvotes: 0

Views: 1174

Answers (1)

(Answer in the comments. See Question with no answers, but issue solved in the comments (or extended in chat) )

The OP wrote:

I managed to solve the problem. It was a netcdf issue.

The main problem was that the compiler I had used to compile netcdf was not the same as the one I had used to compile Noah. Moreover, even when I was linking to a different netcdf directory (compiled with the same compiler), I wasn't using make clean. Doing that solved the problem.

Upvotes: 0

Related Questions