- 问题1:
Fatal Error: Cannot read module file ‘netcdf.mod’ opened at (1), because it was created by a different version of GNU Fortran
解答:在user_build_options中将NETCDFMOD 与 NETCDFLIB 路径设置为netcdf-Fortran的路径。
2.问题2:
collect2: error: ld returned 1 exit status错误多种多样,如下列报错:
./lib/libsmda.a(module_grib2.o): In function
__module_grib2_MOD_fortran_decode_jpeg2000': /home/hsy/Public/hrldas-4.0.1/HRLDAS_init/HRLDAS_forcing/lib/module_grib2.f90:148: undefined reference to
info_jpeg2000’
/home/hsy/Public/hrldas-4.0.1/HRLDAS_init/HRLDAS_forcing/lib/module_grib2.f90:156: undefined reference todecode_jpeg2000' ./lib/libsmda.a(module_grib.o): In function
__module_grib_MOD_findgrib’:
/home/hsy/Public/hrldas-4.0.1/HRLDAS_init/HRLDAS_forcing/lib/module_grib.f90:186: undefined reference toio_fread' /home/hsy/Public/hrldas-4.0.1/HRLDAS_init/HRLDAS_forcing/lib/module_grib.f90:203: undefined reference to
io_fread’
/home/hsy/Public/hrldas-4.0.1/HRLDAS_init/HRLDAS_forcing/lib/module_grib.f90:223: undefined reference toio_fread' /home/hsy/Public/hrldas-4.0.1/HRLDAS_init/HRLDAS_forcing/lib/module_grib.f90:280: undefined reference to
io_ftell’
./lib/libsmda.a(module_grib.o): In function__module_grib_MOD_getgrib': /home/hsy/Public/hrldas-4.0.1/HRLDAS_init/HRLDAS_forcing/lib/module_grib.f90:114: undefined reference to
io_fread’
./lib/libsmda.a(module_grib.o): In function__module_grib_MOD_gribclose': /home/hsy/Public/hrldas-4.0.1/HRLDAS_init/HRLDAS_forcing/lib/module_grib.f90:77: undefined reference to
c_close’
./lib/libsmda.a(module_grib.o): In function__module_grib_MOD_gribopen': /home/hsy/Public/hrldas-4.0.1/HRLDAS_init/HRLDAS_forcing/lib/module_grib.f90:67: undefined reference to
c_gribopen’
collect2: error: ld returned 1 exit status
Makefile:28: recipe for target ‘create_forcing.exe’ failed
make[2]: *** [create_forcing.exe] Error 1
make[2]: Leaving directory ‘/home/hsy/Public/hrldas-4.0.1/HRLDAS_init/HRLDAS_forcing’
Makefile:12: recipe for target ‘default’ failed
make[1]: *** [default] Error 2
make[1]: Leaving directory ‘/home/hsy/Public/hrldas-4.0.1/HRLDAS_init/HRLDAS_forcing’
Makefile:8: recipe for target ‘all’ failed
make: *** [all] Error 2
解答:将user_build_options中的 F90FLAGS = -g -fconvert=big-endian -fbounds-check -fno-range-check -fno-underscoring中的-fno-underscoring注释掉。本人user_build_options如下:
COMPILERF90 = gfortran
FREESOURCE = -ffree-form -ffree-line-length-none
F90FLAGS = -g -fconvert=big-endian -fbounds-check -fno-range-check #-fno-underscoring
MODFLAG =
LDFLAGS =
CPP = /usr/bin/cpp
CPPFLAGS = -P -traditional -D_GFORTRAN_
LIBS =
LIBJASPER = -ljpeg -ljasper
INCJASPER = -I/jasper
NETCDFMOD = -I/home/hsy/anaconda3/envs/ncl_stable/include
NETCDFLIB = -L/home/hsy/anaconda3/envs/ncl_stable/lib -lnetcdf -lnetcdff
BZIP2 = NO
BZIP2_LIB = -lbz2
BZIP2_INCLUDE = -I/usr/include
RM = rm -f
CC = /usr/bin/gcc
3.问题3:
collect3: name = “IVGTYP”
STOP MODULE_NOAHLSM_HRLDAS_INPUT: get_landuse_netcdf: nf90_get_var
解答: 输入文件有误,请修改文件路径,将文件路径改为绝对路径。