LoginSignup
0
0

More than 1 year has passed since last update.

ARWpostのインストールでconfigure.arwpを書き換えないといけない件

Posted at

wrfoutを直接読み込んでいたので、久しくコンパイルしていなかったARWpostなのだが、つまずいたので回避の仕方をメモ的に。

何も考えずにそのまま実行した場合

netcdfが入っていることは前提で。

$ ./configure
Will use NETCDF in dir: ${NETCF}
------------------------------------------------------------------------
Please select from among the following supported platforms.

   1.  PC Linux i486 i586 i686 x86_64, PGI compiler	
   2.  PC Linux i486 i586 i686 x86_64, Intel compiler	
   3.  PC Linux i486 i586 i686 x86_64, gfortran compiler 

Enter selection [1-3] : 2
------------------------------------------------------------------------
Configuration successful. To build the ARWpost, type: compile 
------------------------------------------------------------------------

となるので、コンパイルすると

$  ./compile 
 
**** Compiling ARWpost ****
 
/bin/rm -f module_model_basics.o module_model_basics.mod
/bin/cp module_model_basics.f90 module_model_basics.f
ifort -FR -convert big_endian -I${NETCDF}/include -c module_model_basics.f 
/bin/rm -f module_model_basics.f
/bin/rm -f constants_module.o constants_module.mod
/bin/cp constants_module.f90 constants_module.f

****************中略****************

module_interp.f:(.text+0xd05f): undefined reference to `nf_inq_varid_'
module_interp.f:(.text+0xd185): undefined reference to `nf_inq_varid_'
module_interp.f:(.text+0xd212): undefined reference to `nf_inq_var_'
module_interp.f:(.text+0xd664): undefined reference to `ncvgt_'
module_interp.f:(.text+0xda3a): undefined reference to `ncvgt_'
module_interp.f:(.text+0xdc71): undefined reference to `ncvgt_'
make: [ARWpost.exe] Error 1 (ignored)

となる。

解決策

./configureで作成される、configure.arwpを書き換える。
冷静に見ると

前略
input_module.f:(.text+0x1c4): undefined reference to `nf_inq_var_'
input_module.f:(.text+0x608): undefined reference to `ncvgt_'
input_module.f:(.text+0x808): undefined reference to `ncvgt_'
input_module.f:(.text+0xf93): undefined reference to `ncvgt_'
input_module.f:(.text+0x13bd): undefined reference to `ncvgt_'
input_module.f:(.text+0x16d8): undefined reference to `nf_get_att_text_'
後略

と、netcdf関係のエラーが出ている。
ということで

configure.arwp
32行目 FFLAGS    = -FR -convert big_endian
33行目 F77FLAGS  = -convert big_endian

configure.arwp
32行目 FFLAGS    =  -O3 -FR -convert big_endian -lnetcdff
33行目 F77FLAGS  =  -O3 -convert big_endian  -lnetcdff 

に書き換えた。
一緒に最適化オプションとかも足した。
これで

$ ls
ARWpost.exe  README  arch  clean  compile  configure  configure.arwp  fields.plt  myLIST  namelist.ARWpost  scripts  src  util

無事にARWpost.exeが出てくると。

ちなみに

configure.arwp
32行目 FFLAGS    =  -O3 -FR -convert big_endian -mcmodel=large -shared-intel -lnetcdff
33行目 F77FLAGS  =  -O3 -convert big_endian -mcmodel=large -shared-intel -lnetcdff 

でも行ける。オプションの意味は…

以上です!これでしばらくは困らないはず。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0