爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 2370|回复: 8

求助!hrldas编译时出错

[复制链接]
发表于 2023-10-3 12:11:44 | 显示全部楼层 |阅读模式
10金钱
我在编译hrldas时,遇到下面的错误,我使用的是Intel Fortran

COMPILERF90    =      ifort
FREESOURCE     =      -free
F90FLAGS       =      -convert big_endian -g -O0 -fpe0
MODFLAG        =      -I
LDFLAGS        =
CPP            =      cpp
CPPFLAGS       =      -P -traditional -D_GFORTRAN_
LIBS           =
LIBJASPER      =      -L/apps/lib -ljasper
INCJASPER      =      -I/apps/include
NETCDFMOD      =      -I/apps/include
NETCDFLIB      =      -L/apps/lib -lnetcdf -lnetcdff
BZIP2          =      NO
BZIP2_INCLUDE  =      -I/usr/include
BZIP2_LIB      =      -L/usr/lib64 -lbz2
RM             =      rm -f
CC             =      cc


-------------------------------------------------------------------

报错如下::::

rm -f module_hrldas_netcdf_io.f90
cpp -P -traditional -D_GFORTRAN_ -D_HRLDAS_OFFLINE_  -I/apps/include module_hrldas_netcdf_io.F > module_hrldas_netcdf_io.f90
ifort -o module_hrldas_netcdf_io.o -c -convert big_endian -g -O0 -fpe0  -free -I../MPP -I../Utility_routines -I/apps/include  module_hrldas_netcdf_io.f90
module_hrldas_netcdf_io.f90(16): error #7013: This module file was not generated by any release of this compiler.   [NETCDF]
  use netcdf
------^
module_hrldas_netcdf_io.f90(203): error #6404: This name does not have a type, and must have an explicit type.   [NF90_NOWRITE]
       ierr = nf90_open(wrfinput_flnm, NF90_NOWRITE, ncid)
---------------------------------------^
module_hrldas_netcdf_io.f90(203): error #6404: This name does not have a type, and must have an explicit type.   [NF90_OPEN]
       ierr = nf90_open(wrfinput_flnm, NF90_NOWRITE, ncid)
--------------^
module_hrldas_netcdf_io.f90(205): error #6404: This name does not have a type, and must have an explicit type.   [NF90_INQ_DIMID]
       ierr = nf90_inq_dimid(ncid, "west_east", dimid)
--------------^
module_hrldas_netcdf_io.f90(208): error #6632: Keyword arguments are invalid without an explicit interface.   [LEN]
       ierr = nf90_inquire_dimension(ncid, dimid, len=ix)
--------------------------------------------------^
module_hrldas_netcdf_io.f90(208): error #6404: This name does not have a type, and must have an explicit type.   [NF90_INQUIRE_DIMENSION]
       ierr = nf90_inquire_dimension(ncid, dimid, len=ix)
--------------^
module_hrldas_netcdf_io.f90(214): error #6632: Keyword arguments are invalid without an explicit interface.   [LEN]
       ierr = nf90_inquire_dimension(ncid, dimid, len=jx)
--------------------------------------------------^
module_hrldas_netcdf_io.f90(258): error #6404: This name does not have a type, and must have an explicit type.   [NF90_OPEN]
    ierr = nf90_open(wrfinput_flnm, NF90_NOWRITE, ncid)
-----------^
module_hrldas_netcdf_io.f90(262): error #6404: This name does not have a type, and must have an explicit type.   [NF90_INQ_DIMID]
    ierr = nf90_inq_dimid(ncid, "west_east", dimid)
-----------^
module_hrldas_netcdf_io.f90(265): error #6632: Keyword arguments are invalid without an explicit interface.   [LEN]
    ierr = nf90_inquire_dimension(ncid, dimid, len=ix)
-----------------------------------------------^
module_hrldas_netcdf_io.f90(265): error #6404: This name does not have a type, and must have an explicit type.   [NF90_INQUIRE_DIMENSION]
    ierr = nf90_inquire_dimension(ncid, dimid, len=ix)
-----------^
module_hrldas_netcdf_io.f90(271): error #6632: Keyword arguments are invalid without an explicit interface.   [LEN]
    ierr = nf90_inquire_dimension(ncid, dimid, len=jx)
-----------------------------------------------^
module_hrldas_netcdf_io.f90(274): error #6404: This name does not have a type, and must have an explicit type.   [NF90_GLOBAL]
    ierr = nf90_get_att(ncid, NF90_GLOBAL, "DX", dx)
------------------------------^
module_hrldas_netcdf_io.f90(274): error #6404: This name does not have a type, and must have an explicit type.   [NF90_GET_ATT]
    ierr = nf90_get_att(ncid, NF90_GLOBAL, "DX", dx)
-----------^
module_hrldas_netcdf_io.f90(343): error #6404: This name does not have a type, and must have an explicit type.   [NF90_CLOSE]
    ierr = nf90_close(ncid)
-----------^
module_hrldas_netcdf_io.f90(381): error #6404: This name does not have a type, and must have an explicit type.   [NF90_OPEN]
    ierr = nf90_open(wrfinput_flnm, NF90_NOWRITE, ncid)
-----------^
module_hrldas_netcdf_io.f90(432): error #6404: This name does not have a type, and must have an explicit type.   [NF90_CLOSE]
    ierr = nf90_close(ncid)
-----------^
module_hrldas_netcdf_io.f90(468): error #6404: This name does not have a type, and must have an explicit type.   [NF90_OPEN]
    ierr = nf90_open(wrfinput_flnm, NF90_NOWRITE, ncid)
-----------^
module_hrldas_netcdf_io.f90(487): error #6404: This name does not have a type, and must have an explicit type.   [NF90_CLOSE]
    ierr = nf90_close(ncid)
-----------^
module_hrldas_netcdf_io.f90(521): error #6404: This name does not have a type, and must have an explicit type.   [NF90_OPEN]
    ierr = nf90_open(agdata_flnm, NF90_NOWRITE, ncid)
-----------^
module_hrldas_netcdf_io.f90(530): error #6404: This name does not have a type, and must have an explicit type.   [NF90_INQ_VARID]
    iret = nf90_inq_varid(ncid,  name,  varid)
-----------^
module_hrldas_netcdf_io.f90(532): error #6632: Keyword arguments are invalid without an explicit interface.   [START]
      ierr = nf90_get_var(ncid, varid, irfract, start=(/xstart,ystart/), count=(/xend-xstart+1,yend-ystart+1/))
------------------------------------------------^
module_hrldas_netcdf_io.f90(532): error #6632: Keyword arguments are invalid without an explicit interface.   [COUNT]
      ierr = nf90_get_var(ncid, varid, irfract, start=(/xstart,ystart/), count=(/xend-xstart+1,yend-ystart+1/))
-------------------------------------------------------------------------^
module_hrldas_netcdf_io.f90(532): error #6404: This name does not have a type, and must have an explicit type.   [NF90_GET_VAR]
      ierr = nf90_get_var(ncid, varid, irfract, start=(/xstart,ystart/), count=(/xend-xstart+1,yend-ystart+1/))
-------------^
module_hrldas_netcdf_io.f90(541): error #6632: Keyword arguments are invalid without an explicit interface.   [START]
      ierr = nf90_get_var(ncid, varid, sifract, start=(/xstart,ystart/), count=(/xend-xstart+1,yend-ystart+1/))
------------------------------------------------^
module_hrldas_netcdf_io.f90(541): error #6632: Keyword arguments are invalid without an explicit interface.   [COUNT]
      ierr = nf90_get_var(ncid, varid, sifract, start=(/xstart,ystart/), count=(/xend-xstart+1,yend-ystart+1/))
-------------------------------------------------------------------------^
module_hrldas_netcdf_io.f90(550): error #6632: Keyword arguments are invalid without an explicit interface.   [START]
      ierr = nf90_get_var(ncid, varid, mifract, start=(/xstart,ystart/), count=(/xend-xstart+1,yend-ystart+1/))
------------------------------------------------^
module_hrldas_netcdf_io.f90(550): error #6632: Keyword arguments are invalid without an explicit interface.   [COUNT]
      ierr = nf90_get_var(ncid, varid, mifract, start=(/xstart,ystart/), count=(/xend-xstart+1,yend-ystart+1/))
-------------------------------------------------------------------------^
module_hrldas_netcdf_io.f90(559): error #6632: Keyword arguments are invalid without an explicit interface.   [START]
      ierr = nf90_get_var(ncid, varid, fifract, start=(/xstart,ystart/), count=(/xend-xstart+1,yend-ystart+1/))
------------------------------------------------^
module_hrldas_netcdf_io.f90(559): error #6632: Keyword arguments are invalid without an explicit interface.   [COUNT]
      ierr = nf90_get_var(ncid, varid, fifract, start=(/xstart,ystart/), count=(/xend-xstart+1,yend-ystart+1/))
-------------------------------------------------------------------------^
module_hrldas_netcdf_io.f90(6876): catastrophic error: Too many errors, exiting
compilation aborted for module_hrldas_netcdf_io.f90 (code 1)
Makefile:37: recipe for target 'module_hrldas_netcdf_io.o' failed
make: *** [module_hrldas_netcdf_io.o] Error 1

请问这是netcdf 安装的问题吗,但是我确认了netcdf 安装路径就在 /apps下
请教各位大佬有遇到过这个问题的吗


最佳答案

查看完整内容

This module file was not generated by any release of this compiler. 看着像是说,netcdf是用其他编译器编译的比如gcc gfortran/pgi等,交叉编译必须严格使用同一类型的编译器编译,不能外部库用a编译器,主程序用b编译器这种。
密码修改失败请联系微信:mofangbao
发表于 2023-10-3 12:11:45 | 显示全部楼层
This module file was not generated by any release of this compiler.
看着像是说,netcdf是用其他编译器编译的比如gcc gfortran/pgi等,交叉编译必须严格使用同一类型的编译器编译,不能外部库用a编译器,主程序用b编译器这种。
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

 楼主| 发表于 2023-10-3 12:14:14 | 显示全部楼层
装了hdf5-1.10.1、netcdf-4.6.1、netcdf-fortran-4.4.4、以及netcdf-cxx
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

 楼主| 发表于 2023-10-3 15:11:39 | 显示全部楼层
weilin421 发表于 2023-10-3 14:39
This module file was not generated by any release of this compiler.
看着像是说,netcdf是用其他编译 ...

您好,我想请问一下如何让netcdf 和 hrldas用同一种编译器编译呢,我安装了Intel® oneAPI Base Toolkit 和HPC Toolkit。netcdf怎么指定用intel编译呢,我安装netcdf的时候,configure 以后 就直接make了
./configure --enable-shared --enable-fortran--enable-netcdf-4 --disable-dap CPPFLAGS=-I/apps/include LDFLAGS=-L/apps/lib --prefix=/apps
make
make install
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

发表于 2023-10-3 16:25:00 | 显示全部楼层
CC=icc CXX=icpc FC=ifort
大概是这样吧,我记得ifort里面有一个脚本可以自动设置这些环境变量,类似的环境变量还有F90 F77好像,但是这俩用的不多,netcdf编译用上面那三个应该就够了,make时候你可以稍微看下,如果是ifort命令编译的就问题不大。
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

 楼主| 发表于 2023-10-3 21:22:17 | 显示全部楼层
weilin421 发表于 2023-10-3 16:25
CC=icc CXX=icpc FC=ifort
大概是这样吧,我记得ifort里面有一个脚本可以自动设置这些环境变量,类似的环 ...

好的,谢谢,我看了一下确实netcdf是gcc编译的,不知道为什么我已经配置了相关的环境变量,也source了,但是他没用ifort命令去编译
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

发表于 2023-10-3 21:32:11 | 显示全部楼层
netcdf-fortran-4.4.4 这个也得用ifort重编译,之前可能用的gfortran。
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

 楼主| 发表于 2023-10-8 19:03:03 | 显示全部楼层
weilin421 发表于 2023-10-3 21:32
netcdf-fortran-4.4.4 这个也得用ifort重编译,之前可能用的gfortran。

好的谢谢!我把前面用gcc编译的都改过来了
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

发表于 2023-12-30 21:12:45 | 显示全部楼层
感谢楼主,我重新用ifort编译后也成功了,不过后面又报了MPI的类似错误。
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表