在 Ubuntu 中编译 NOAA WAVEWATCH III 出错

在 Ubuntu 中编译 NOAA WAVEWATCH III 出错

我正在尝试编译 NOAA WW3 模型,每次尝试执行w3_make文件时,都会收到此消息:

               *****************************
              ***   WAVEWATCH III make      ***
                *****************************

 Exporting WWATCH3_ENV=/home/admon/WW3/model/bin/wwatch3.env
Main directory    : /home/admon/WW3/model
Scratch directory : /home/admon/WW3/model/tmp
Save source codes : yes
Save listings     : yes

[INFO] list of the programs selected : ww3_grid ww3_strt ww3_bound ww3_outf ww3_outp ww3_trck ww3_grib ww3_gint gx_outf gx_outp ww3_uprstr ww3_multi ww3_sbs1 libww3 ww3_gspl ww3_prep ww3_shel ww3_prnc ww3_ounf ww3_ounp ww3_bounc ww3_trnc
Making makefile ...

                *****************************
              ***   WAVEWATCH III makefile  ***
                *****************************

switch = /home/admon/WW3/model/bin/switch
   Checking all subroutines for modules (this may take a while) ...

Processing ww3_grid
---------------------
ad3 : processing constants 
mv: cannot stat 'constants.o': No such file or directory
ad3 : processing w3servmd 
mv: cannot stat 'w3servmd.o': No such file or directory
ad3 : processing w3gsrumd 
ad3 : processing w3arrymd 
mv: cannot stat 'w3arrymd.o': No such file or directory
mv: cannot stat 'w3gsrumd.o': No such file or directory
ad3 : processing w3gdatmd 
mv: cannot stat 'w3gdatmd.o': No such file or directory
ad3 : processing w3odatmd 
ad3 : processing w3idatmd 
mv: cannot stat 'w3idatmd.o': No such file or directory
mv: cannot stat 'w3odatmd.o': No such file or directory
ad3 : processing w3dispmd 
ad3 : processing w3nmlgridmd 
ad3 : processing w3timemd 
ad3 : processing w3adatmd 
mv: cannot stat 'w3dispmd.o': No such file or directory
mv: cannot stat 'w3nmlgridmd.o': No such file or directory
mv: cannot stat 'w3adatmd.o': No such file or directory
mv: cannot stat 'w3timemd.o': No such file or directory

然后,我尝试执行w3_automake文件并进行编译,直到它必须处理程序ww3_ounf并显示此消息:

Processing ww3_ounf
---------------------
ad3 : processing ww3_ounf 
mv: cannot stat 'ww3_ounf.o': No such file or directory
      Linking ww3_ounf
      *** file ww3_ounf.o not found ***
*** Missing object files ***
makefile:431: recipe for target '/home/admon/WW3/model/exe/ww3_ounf' failed
make: *** [/home/admon/WW3/model/exe/ww3_ounf] Error 3

我尝试重新安装很多次,但总是收到错误消息。知道发生了什么吗?

编辑:2019 年 11 月 14 日 这是要打印的结果nc-config --all

This netCDF 4.4.1 has been built with the following features: 

  --cc        -> gcc
  --cflags    ->  -I/home/admon/software/wrf/build_wrf/libraries/netcdf/include 
  --libs      -> 

  --has-c++   -> no
  --cxx       -> 
  --has-c++4  -> no
  --cxx4      -> 

  --fc        -> 
  --fflags    -> 
  --flibs     -> 
  --has-f90   -> no
  --has-f03   -> no

  --has-dap   -> no
  --has-nc2   -> yes
  --has-nc4   -> no
  --has-hdf5  -> no
  --has-hdf4  -> no
  --has-logging-> no
  --has-pnetcdf-> no
  --has-szlib -> 

  --prefix    -> /home/admon/software/wrf/build_wrf/libraries/netcdf
  --includedir-> /home/admon/software/wrf/build_wrf/libraries/netcdf/include
  --version   -> netCDF 4.4.1

这是要打印的结果nf-config --all

This netCDF-Fortran 4.4.4 has been built with the following features:

--cc        -> gcc
  --cflags    ->  -I/home/admon/software/wrf/build_wrf/libraries/netcdf/include -I/home/admon/software/wrf/build_wrf/libraries/netcdf/include

  --fc        -> gfortran
  --fflags    -> -I/home/admon/software/wrf/build_wrf/libraries/netcdf/include
  --flibs     -> -L/home/admon/software/wrf/build_wrf/libraries/netcdf/lib -lnetcdff -L/home/admon/software/wrf/build_wrf/libraries/netcdf/lib -lnetcdf -lnetcdf 
  --has-f90   -> no
  --has-f03   -> yes

  --has-nc2   -> yes
  --has-nc4   -> no

  --prefix    -> /home/admon/software/wrf/build_wrf/libraries/netcdf
  --includedir-> /home/admon/software/wrf/build_wrf/libraries/netcdf/include
  --version   -> netCDF-Fortran 4.4.4

我一直在阅读用户指南,似乎需要启用 nc4-api,但我不知道为什么当我安装我的库时它没有启用。

答案1

这可能是你的 switch 文件的问题。在运行 w3_automake 之前,你是如何设置 w3_setup 的?

w3_setup <main_dir> -c <comp> -s <switch>

答案2

我已经追踪到错误,你应该把 nc-config 的确切位置放在 bashrc 上(不仅是目录,还有 nc-config),这样 ww3_prnc ww3_ounf ww3_ounp 才会被编译

导出 NETCDF_CONFIG=$HOME/Library/bin/nc-config

答案3

也可以尝试这个

F90 NOGRB NC4 TRKNC NOPA LRB4 SHRD PR3 UQ FLX2 LN1 ST2 STAB2 NL1 BT1 DB1 MLIM TR0 BS0 IC0 REF0 XX0 WNT1 WNX1 CRT1 CRX1 IS0 O0 O1 O2 O3 O4 O5 O6 O7 O11 O14

相关内容