Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

Problem compiling WRFDA-no da_wrf

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.

MUWRFDA

New member
I have been trying to install WRFDA with rttov113 on ubuntu 18.10 for over one week with no success. WRFPLUS compiles without any problem. I have downloaded 7 coefficient files and placed them in the folder "rtcoef_rttov11" in the rttov113 source directory.
When I replace LIB_EXTERNAL with the entry below I get 43 executables, without da_wrfvar.exe
The errors in compile.out are a lot of "undefined reference to ..."
ranlib libwrfvar.a
0.24user 0.63system 0:01.72elapsed 50%CPU (0avgtext+0avgdata 31180maxresident)k
0inputs+16outputs (0major+5769minor)pagefaults 0swaps
rm -f da_wrfvar.exe
module_quilt_outbuf_ops.o: In function `__module_quilt_outbuf_ops_MOD_write_outbuf':
module_quilt_outbuf_ops.f90:(.text+0x328e): undefined reference to `ext_gr2_write_field_'
./libwrfvar.a(module_io.o): In function `__module_io_MOD_wrf_get_var_info':
module_io.f90:(.text+0x4f5): undefined reference to `ext_gr2_get_var_info_'
./libwrfvar.a(module_io.o): In function `__module_io_MOD_wrf_get_next_var':
module_io.f90:(.text+0x6e7): undefined reference to `ext_gr2_get_next_var_'
./libwrfvar.a(module_io.o): In function `__module_io_MOD_wrf_set_time':
module_io.f90:(.text+0x91a): undefined reference to `ext_gr2_set_time_'
./libwrfvar.a(module_io.o): In function `__module_io_MOD_wrf_get_previous_time':
module_io.f90:(.text+0xba7): undefined reference to `ext_gr2_get_previous_time_'
./libwrfvar.a(module_io.o): In function `__module_io_MOD_wrf_get_next_time':
module_io.f90:(.text+0xe33): undefined reference to `ext_gr2_get_next_time_'
./libwrfvar.a(module_io.o): In function `__module_io_MOD_wrf_ioclose':
module_io.f90:(.text+0x10d4): undefined reference to `ext_gr2_ioclose_'
./libwrfvar.a(module_io.o): In function `__module_io_MOD_wrf_iosync':
module_io.f90:(.text+0x12f8): undefined reference to `ext_gr2_iosync_'
./libwrfvar.a(module_io.o): In function `__module_io_MOD_wrf_inquire_filename':
module_io.f90:(.text+0x155a): undefined reference to `ext_gr2_inquire_filename_'
./libwrfvar.a(module_io.o): In function `__module_io_MOD_wrf_inquire_opened':
module_io.f90:(.text+0x17d7): undefined reference to `ext_gr2_inquire_opened_'
./libwrfvar.a(module_io.o): In function `__module_io_MOD_wrf_open_for_read':
module_io.f90:(.text+0x1d1b): undefined reference to `ext_gr2_open_for_read_'
./libwrfvar.a(module_io.o): In function `__module_io_MOD_wrf_open_for_read_commit':
module_io.f90:(.text+0x2008): undefined reference to `ext_gr2_open_for_read_commit_'
./libwrfvar.a(module_io.o): In function `__module_io_MOD_wrf_open_for_read_begin':
module_io.f90:(.text+0x249c): undefined reference to `ext_gr2_open_for_read_begin_'
./libwrfvar.a(module_io.o): In function `__module_io_MOD_wrf_open_for_write_commit':

just too many

LIB_EXTERNAL = \
-L$(WRF_SRC_ROOT_DIR)/external/io_netcdf -lwrfio_nf -L/usr/local/lib -lnetcdff -lnetcdf -L/usr/local/lib -lhdf5_fortran -lhdf5 -lhdf5hl_fortran -lhdf5_hl -L$HOME/rttov113/lib -lm -lz

When I replace LIB_EXTERNAL with the entry below I get 10 executables, without da_wrfvar.exe
The errors are
ranlib libwrfvar.a
0.05user 0.20system 0:00.99elapsed 25%CPU (0avgtext+0avgdata 31052maxresident)k
0inputs+16outputs (0major+5768minor)pagefaults 0swaps
rm -f da_wrfvar.exe
/usr/bin/ld: cannot find -lrttov11_test
/usr/bin/ld: cannot find -lrttov11_other
/usr/bin/ld: cannot find -lrttov11_mw_scatt
/usr/bin/ld: cannot find -lrttov11_parallel
collect2: error: ld returned 1 exit status

LIB_EXTERNAL = \
-L$(WRF_SRC_ROOT_DIR)/external/io_netcdf -lwrfio_nf -L/usr/local/lib -lnetcdff -lnetcdf -L/usr/local/lib -lhdf5_fortran -lhdf5 -lhdf5hl_fortran -lhdf5_hl -lm -lz -L$HOME/rttov113/lib -lrttov11_test -lrttov11_other -lrttov11_mw_scatt -lrttov11_coef_io -lrttov11_hdf -lrttov11_parallel -lrttov11_main

I wonder if am missing an library or the order in the libraries is not ok.
I will appreciate an assistance.
 
Please try the following setting.

Code:
LIB_EXTERNAL    = -L$HOME/rttov113/lib -lrttov11_hdf -lrttov11_gui -lrttov11_main \
                  -L$(WRF_SRC_ROOT_DIR)/external/io_netcdf -lwrfio_nf -L/usr/local/lib -lnetcdff -lnetcdf
 
Thanks hclin2018 for the effort. The compile options you gave me give 10 executables which are
28 -rwxr-xr-x 1 zmumba zmumba 24956 Oct 8 20:08 var/build/da_advance_time.exe
84 -rwxr-xr-x 1 zmumba zmumba 83916 Oct 8 20:10 var/build/da_bias_airmass.exe
84 -rwxr-xr-x 1 zmumba zmumba 83576 Oct 8 20:09 var/build/da_bias_scan.exe
40 -rwxr-xr-x 1 zmumba zmumba 38088 Oct 8 20:09 var/build/da_bias_sele.exe
48 -rwxr-xr-x 1 zmumba zmumba 46608 Oct 8 20:09 var/build/da_bias_verif.exe
132 -rwxr-xr-x 1 zmumba zmumba 132660 Oct 8 20:09 var/build/da_tune_obs_desroziers.exe
260 -rwxr-xr-x 1 zmumba zmumba 262836 Oct 8 20:10 var/build/da_tune_obs_hollingsworth1.exe
148 -rwxr-xr-x 1 zmumba zmumba 148164 Oct 8 20:10 var/build/da_tune_obs_hollingsworth2.exe
128 -rwxr-xr-x 1 zmumba zmumba 128600 Oct 8 20:10 var/build/gen_be_stage2_gsi.exe
0 lrwxrwxrwx 1 zmumba zmumba 15 Oct 8 20:27 var/obsproc/obsproc.exe -> src/obsproc.exe
 
Does your directory $HOME/rttov113/lib contain all the following files?
librttov11_brdf_atlas.a
librttov11_coef_io.a
librttov11_coef_io_789.a
librttov11_emis_atlas.a
librttov11_gui.a
librttov11_hdf.a
librttov11_main.a
librttov11_mw_scatt.a
librttov11_mw_scatt_coef.a
librttov11_other.a
librttov11_parallel.a
librttov11_test.a
librttov11_wrapper.a
 
setenv HDF5 your_hdf5_path
configure wrfda
edit configure.wrf to add
-L$HOME/rttov113/lib -lrttov11_hdf -lrttov11_gui -lrttov11_main
as shown in my previous post.
 
Hello,
I have recompiled rttov113 and I have all the libraries in lib.
I have edited LIB_External in configure.wrf, it now looks like
LIB_EXTERNAL = \
-L$(WRF_SRC_ROOT_DIR)/external/io_netcdf -lwrfio_nf -L/usr/local/lib -lnetcdff -lnetcdf -L$(WRF_SRC_ROOT_DIR)/external/io_grib2 -lio_grib2 -L/usr/local/lib -ljasper -L/usr/local/lib -lhdf5_fortran -lhdf5 -lm -lz -L$HOME/rttov113/lib -lrttov11_hdf -lrttov11_gui -lrttov11_main

I am waiting for output of compile
 
Unfortunately with this modification to LB_EXTERNAL I still get a lot of undefined reference, some of which are
ranlib libwrfvar.a
0.08user 0.18system 0:00.95elapsed 28%CPU (0avgtext+0avgdata 31136maxresident)k
0inputs+16outputs (0major+5763minor)pagefaults 0swaps
rm -f da_wrfvar.exe
/usr/local/lib/libjasper.a(jas_stream.o): In function `jas_stream_tmpfile':
jas_stream.c:(.text+0x4f0): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
/home/zmumba/rttov113/lib/librttov11_hdf.a(rttov_hdf_coefs.o): In function `__rttov_hdf_coefs_MOD_rttov_hdf_pccoef_wh':
rttov_hdf_coefs.F90:(.text+0xb148): undefined reference to `__h5lt_const_MOD_h5ltset_attribute_string_f'
/home/zmumba/rttov113/lib/librttov11_hdf.a(rttov_hdf_coefs.o): In function `__rttov_hdf_coefs_MOD_rttov_hdf_scaercoef_wh':
rttov_hdf_coefs.F90:(.text+0xbf0a): undefined reference to `__h5lt_const_MOD_h5ltset_attribute_string_f'
/home/zmumba/rttov113/lib/librttov11_hdf.a(rttov_hdf_coefs.o): In function `__rttov_hdf_coefs_MOD_rttov_hdf_sccldcoef_wh':
rttov_hdf_coefs.F90:(.text+0xdbe3): undefined reference to `__h5lt_const_MOD_h5ltset_attribute_string_f'
/home/zmumba/rttov113/lib/librttov11_hdf.a(rttov_hdf_coefs.o): In function `__rttov_hdf_coefs_MOD_rttov_hdf_coef_wh':
rttov_hdf_coefs.F90:(.text+0x12838): undefined reference to `__h5lt_const_MOD_h5ltset_attribute_string_f'
 
Seems two additional libs (-lhdf5hl_fortran -lhdf5_hl) are needed.
I'd also suggest removing unnecessary jasper and grib2 lib.
-lrttov11_gui and -lrttov11_main are also not needed.

LIB_EXTERNAL = \
-L$(WRF_SRC_ROOT_DIR)/external/io_netcdf -lwrfio_nf -L/usr/local/lib -lnetcdff -lnetcdf \
-L/usr/local/lib -lhdf5_fortran -lhdf5 -lm -lz -lhdf5hl_fortran -lhdf5_hl \
-L$HOME/rttov113/lib -lrttov11_hdf
 
Thank you very much hclin2018 for your time and all the effort. Initially I was configuring with "./configure wrfda". After changing to "./configure 4dvar"and the last LIB_EXTERNAL compile options you gave me, I am getting 43 executables but without da_wrfvar.exe.
I have never had so much trouble installing WRF related software. I installed WRFDA version 3.9.1 but then removed it.
I am now suspecting that I may have set some paths incorrectly. Could you please advise me on the paths for WRFDA and WRFPLUS in my .bashrc below (should the path include WRFDA, WRFPLUS and should WRFPLUS be inside WRFDA?)

export WRFDA_DIR=$HOME/WRF/DA/WRFDA
export WRFPLUS_DIR=$HOME/DA/WRFPLUS
export DAT_DIR=$WRFDA_DIR/DATA
export WORK_DIR=$WRFDA_DIR/workdir

i have a lot of the error below, but no longer any undefined reference
f951: Warning: Nonexistent include directory ‘/home/zmumba/DA/WRFPLUS/dyn_em’ [-Wmissing-include-dirs]
f951: Warning: Nonexistent include directory ‘/home/zmumba/DA/WRFPLUS/main’ [-Wmissing-include-dirs]
f951: Warning: Nonexistent include directory ‘/home/zmumba/DA/WRFPLUS/frame’ [-Wmissing-include-dirs]
f951: Warning: Nonexistent include directory ‘/home/zmumba/DA/WRFPLUS/share’ [-Wmissing-include-dirs]
f951: Warning: Nonexistent include directory ‘/home/zmumba/DA/WRFPLUS/wrftladj’ [-Wmissing-include-dirs]
da_transfer_model.f:60:7:

use da_4dvar, only : model_grid, push_ad_forcing, push_tl_pert, pop_tl_pert, kj_swap, &
1
Fatal Error: Can't open module file ‘da_4dvar.mod’ for reading at (1): No such file or directory
compilation terminated.
Command exited with non-zero status 1
 
For V4.0: older WRFPLUS code can not be used to compile V4.0 4DVAR.

cd /your_code_dir_top
tar zxvf WRFV4.0.TAR.gz
mv WRF WRFPLUS
cd WRFPLUS
./configure wrfplus
./compile wrfplus
make sure main/wrfplus.exe is generated.

setenv WRFPLUS_DIR /your_code_dir_top/WRFPLUS
setenv RTTOV /your_rttov_dir
setenv HDF5 /your_hdf5_dir

cd /your_code_dir_top
tar zxvf WRFV4.0.TAR.gz
mv WRF WRFDA
cd WRFDA
./configure 4dvar
edit configure.wrf to add hdf5hl_fortran and hdf5_hl and rttov11_hdf libs to LIB_EXTERNAL.
./compile all_wrfvar
 
Hello once again,
For anyone who may read my post and are able to assist.
After installing g2lib all my errors seem to disappear, I now have a lot of implicit declaration warnings for a number of files in the registry.
I get 43 executables with only da_wrfvar.exe missing.
The implicit declaration warnings are purely a c/c++ issue, and googling does not help.
There is probably a flag or setting am missing in some file.
I would appreciate if there is anybody who has experienced such a problem before, and can share the solution.
Thanks

registry.c: In function ‘main’:
registry.c:63:3: warning: implicit declaration of function ‘sym_forget’; did you mean ‘sym_get’? [-Wimplicit-function-declaration]
sym_forget() ;
^~~~~~~~~~
sym_get
registry.c:135:3: warning: implicit declaration of function ‘gen_io_boilerplate’ [-Wimplicit-function-declaration]
gen_io_boilerplate() ; /* 20091213 jm. Generate the io_boilerplate_temporary.inc file */
^~~~~~~~~~~~~~~~~~
registry.c:137:3: warning: implicit declaration of function ‘init_parser’; did you mean ‘reg_parse’? [-Wimplicit-function-declaration]
init_parser() ;
^~~~~~~~~~~
 
Top