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

Unable to compile all_wrfvar WRFDA

Hello,

I am trying to compile the data assimilation routines available in WRFDA. I have successfully compiled WRFPLUS, but I get several errors when trying to compile WRFDA (./compile all_wrfvar).
In particular, I get errors of the form:

./libwrfvar.a(da_netcdf_interface.o): in function "__da_netcdf_interface_MOD_da_get_bdytimestr_cdf":
da_netcdf_interface.f:(.text+0x6ee): undefined reference to "ncopn_"

Obviously, the *.exe files were not generated by the compilation.

I include here the configure.wrf and compile.out files.

I am using gfortran/gcc-9.1.0 and the versions of netCDF I am using are netCDF4.7.0 and netCDF-fortran4.4.5.
I will also attach the features of the used nerCDF versions as reported from the commands nf(nc)-config --all.

The netcdf libraries are linked as follows:

export NETCDF=/apps/netCDF4.7.0--gcc-9.1.0

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/apps/netCDF-Fortran-4.4.5--gcc-9.1.0/lib

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/apps/netCDF-Fortran-4.4.5--gcc-9.1.0/include

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/apps/netCDF4.7.0--gcc-9.1.0/lib

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/apps/netCDF4.7.0--gcc-9.1.0/include


I have tried to do the same process on another computer with intel/ifort (netcdf4.6.2 and netcdf-fortran4.4.4) but obtained the same result.


What am I doing wrong?
I would appreciate any suggestion from you on how to solve this problem.

Kind regards,

Giorgio
 

Attachments

  • configure_wrf.txt
    20.7 KB · Views: 6
  • nc-config.txt
    1.2 KB · Views: 1
  • nf-config.txt
    745 bytes · Views: 2
  • compile_out.txt
    584.2 KB · Views: 11
So looking at the compile_out.txt in lines 1-3 the WRF_EM_CORE and WRF_PLUS_CORE variables are not exported in your environment. That might be one possible solution to the problem.

In the compile_out.txt it appears that the netcdf-c libraries are linked properly
-L/apps/netCDF4.7.0--gcc-9.1.0/lib -lnetcdff -lnetcdf
But it looks like the netcdf-fortran files are not linking from ld library path at all. Searching the compile_out.txt file for "netCDF-Fortran-4.4.5" does not yield any results.

Could you echo your $LD_LIBRARY_PATH and put that as a reply?
 
First of all, thanks for the fast reply!

The result of echo $LD_LIBRARY_PATH :

/apps/netCDF-Fortran-4.4.5--gcc-9.1.0/lib:/apps/MATLAB/R2018b/bin/glnxa64/:/apps/MATLAB/R2018b/sys/os/glnxa64/:/apps/mpich-3.2.1--gcc-9.1.0/lib:/apps/gcc-9.1.0/local/lib64:/apps/hdf5-1.10.5--gcc-9.1.0/lib:/apps/netCDF4.7.0--gcc-9.1.0/include:/apps/netCDF4.7.0--gcc-9.1.0/lib:/apps/netCDF-Fortran-4.4.5--gcc-9.1.0/lib:/apps/netCDF-Fortran-4.4.5--gcc-9.1.0/include:/apps/netCDF4.7.0--gcc-9.1.0/lib:/apps/netCDF4.7.0--gcc-9.1.0/include

I will try to export also the two variables WRF_EM_CORE and WRF_PLUS_CORE as you suggested and let you know the result later on.
 
Hello,
after a clean -a, I performed once again the procedure, adding this time:

export WRF_EM_CORE=1
export WRF_PLUS_CORE=1

I had to kill the compilation process (./compile all_wrfvar) since the final volume of the compile.out was growing uncontrollably (it reached almost 10GB).
I could not manage to save all the compile.out for inspection, but I report here a fraction of the file (printed in the shell). The reported section is followed by a lot of lines (several thousands) reading:

WARNING: There is no 4D array named pert3d

The configure.wrf file is the same as before (I have reported it for completeness).

Now, after exporting the *_CORE variables, should I also change something in the configure.wrf?
(I had never touched the *_CORE variables before, so some missing corrections in the configure.wrf could be the reason for the failure of the procedure.)

Please let me know if I can provide you more useful information to help me fix this issue.

Thanks for your help.
 

Attachments

  • compile_out_partial.txt
    8 KB · Views: 5
  • configure_wrf_CORES.txt
    20.7 KB · Views: 3
Hello,
after a clean -a, I performed once again the procedure, adding this time:

export WRF_EM_CORE=1
export WRF_PLUS_CORE=1

I had to kill the compilation process (./compile all_wrfvar) since the final volume of the compile.out was growing uncontrollably (it reached almost 10GB).
I could not manage to save all the compile.out for inspection, but I report here a fraction of the file (printed in the shell). The reported section is followed by a lot of lines (several thousands) reading:

WARNING: There is no 4D array named pert3d

The configure.wrf file is the same as before (I have reported it for completeness).

Now, after exporting the *_CORE variables, should I also change something in the configure.wrf?
(I had never touched the *_CORE variables before, so some missing corrections in the configure.wrf could be the reason for the failure of the procedure.)

Please let me know if I can provide you more useful information to help me fix this issue.

Thanks for your help.
can you set up the exports again on a new terminal.

then type in the following commands

echo $PATH
echo $LD_LIBRARY_PATH
env | sort

and post them here please. That will help me see if the exports aren't going to the system.
 
echo $PATH

/apps/netCDF-Fortran-4.4.5--gcc-9.1.0/bin:/apps/cdo-1.9.10/bin:/apps/nco-4.9.7:/apps/MATLAB/R2018b/bin:/apps/ncview-1.93g/bin:/apps/mpich-3.2.1--gcc-9.1.0/bin:/apps/gcc-9.1.0/local/bin:/apps/hdf5-1.10.5--gcc-9.1.0/bin:/apps/netCDF4.7.0--gcc-9.1.0/include:/apps/netCDF4.7.0--gcc-9.1.0/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/pbs/bin:/home/giorgio.doglioni/.local/bin:/home/giorgio.doglioni/bin

echo $LD_LIBRARY_PATH

/apps/netCDF-Fortran-4.4.5--gcc-9.1.0/lib:/apps/MATLAB/R2018b/bin/glnxa64/:/apps/MATLAB/R2018b/sys/os/glnxa64/:/apps/mpich-3.2.1--gcc-9.1.0/lib:/apps/gcc-9.1.0/local/lib64:/apps/hdf5-1.10.5--gcc-9.1.0/lib:/apps/netCDF4.7.0--gcc-9.1.0/include:/apps/netCDF4.7.0--gcc-9.1.0/lib:/apps/netCDF-Fortran-4.4.5--gcc-9.1.0/lib:/apps/netCDF-Fortran-4.4.5--gcc-9.1.0/include:/apps/netCDF4.7.0--gcc-9.1.0/lib:/apps/netCDF4.7.0--gcc-9.1.0/include:/apps/netCDF-Fortran-4.4.5--gcc-9.1.0/lib:/apps/netCDF-Fortran-4.4.5--gcc-9.1.0/include:/apps/netCDF4.7.0--gcc-9.1.0/lib:/apps/netCDF4.7.0--gcc-9.1.0/include

The result of the env | sort command is attached as text file.
 

Attachments

  • env|sort.txt
    5 KB · Views: 5
Thank you let me review them and see what I can come up with.
 
echo $PATH

/apps/netCDF-Fortran-4.4.5--gcc-9.1.0/bin:/apps/cdo-1.9.10/bin:/apps/nco-4.9.7:/apps/MATLAB/R2018b/bin:/apps/ncview-1.93g/bin:/apps/mpich-3.2.1--gcc-9.1.0/bin:/apps/gcc-9.1.0/local/bin:/apps/hdf5-1.10.5--gcc-9.1.0/bin:/apps/netCDF4.7.0--gcc-9.1.0/include:/apps/netCDF4.7.0--gcc-9.1.0/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/pbs/bin:/home/giorgio.doglioni/.local/bin:/home/giorgio.doglioni/bin

echo $LD_LIBRARY_PATH

/apps/netCDF-Fortran-4.4.5--gcc-9.1.0/lib:/apps/MATLAB/R2018b/bin/glnxa64/:/apps/MATLAB/R2018b/sys/os/glnxa64/:/apps/mpich-3.2.1--gcc-9.1.0/lib:/apps/gcc-9.1.0/local/lib64:/apps/hdf5-1.10.5--gcc-9.1.0/lib:/apps/netCDF4.7.0--gcc-9.1.0/include:/apps/netCDF4.7.0--gcc-9.1.0/lib:/apps/netCDF-Fortran-4.4.5--gcc-9.1.0/lib:/apps/netCDF-Fortran-4.4.5--gcc-9.1.0/include:/apps/netCDF4.7.0--gcc-9.1.0/lib:/apps/netCDF4.7.0--gcc-9.1.0/include:/apps/netCDF-Fortran-4.4.5--gcc-9.1.0/lib:/apps/netCDF-Fortran-4.4.5--gcc-9.1.0/include:/apps/netCDF4.7.0--gcc-9.1.0/lib:/apps/netCDF4.7.0--gcc-9.1.0/include

The result of the env | sort command is attached as text file.
Just out of curiosity are you installing WRFDA and WRFPLUS in the same folder as the WRF installation folder?

The reason I mentioned this is because I saw this in the installation guide:

Note: The source code for WRFDA and WRFPLUS are contained in the Basic WRF tar file. Although the WRF and WRFDA source code is packaged together, they can not be built together. To build basic WRF, one would need to download the tar file again and build it separately (in a separate directory). For instructions to build WRFDA versions prior to V4.0, please see: http://www2.mmm.ucar.edu/wrf/users/docs/user_guide_V3.9/users_guide_chap6.htm#_Installing_WRFDA_for_1.
 
Just out of curiosity are you installing WRFDA and WRFPLUS in the same folder as the WRF installation folder?

The reason I mentioned this is because I saw this in the installation guide:
Hi,

no, WRFPLUS and WRFDA are installed in separate directories, which are different from the directory of the installed basic WRF. Practically speaking, I have downloaded the basic tar file 3 times (one to build the basic WRF, one for WRFPLUS and one for WRFDA).

WRFPLUS: /home/giorgio.doglioni/WRFDA/WRFPLUS/
WRFDA : /home/giorgio.doglioni/WRFDA/WRFVAR/
WRF : /home/giorgio.doglioni/WRF

I want to add a recently discovered piece of information that might be relevant for the resolution of the issue. Please, have a look at the link below:


I know it is about the ICON model, but the issue seems the same. If this detail is not relevant, please ignore it.

Have a good day.
 
Last edited:
Hi,

no, WRFPLUS and WRFDA are installed in separate directories:

WRFPLUS: /home/giorgio.doglioni/WRFDA/WRFPLUS/
WRFDA : /home/giorgio.doglioni/WRFDA/WRFVAR/

I want to add a recently discovered piece of information that might be relevant for the resolution of the issue. Please, have a look at the link below:


I know it is about the ICON model, but the issue seems the same. If this detail is not relevant, please ignore it.

Have a good day.
I've always installed my WRFDA and WRFPLUS in completely different folders.

Bash:
export WRF_DIR=$HOME/WRF/WRFV4.4.1   #WRF installation folder

export WRFPLUS_DIR=$HOME/WRF/WRFPLUS  #WRFPLUS installation folder

cd $HOME/WRF/WRFDA                    #WRFDA installation folder

Perhaps the reason they are both under the WRDA folder might be the issue? Sadly we are reaching the limits of my knowledge. May have to ask @kwerner or @Ming Chen for their help as they are more familiar with the ins and outs of WRF.

Might also be a netcdf compatibility problem with older netcdf version and the newer WRF model. Perhaps trying the latest netcdf-c version 4.9.0 and netcdf-fortran version 4.6.0 (they are meant to be used together) may solve the problem.
 
I've always installed my WRFDA and WRFPLUS in completely different folders.

Bash:
export WRF_DIR=$HOME/WRF/WRFV4.4.1   #WRF installation folder

export WRFPLUS_DIR=$HOME/WRF/WRFPLUS  #WRFPLUS installation folder

cd $HOME/WRF/WRFDA                    #WRFDA installation folder

Perhaps the reason they are both under the WRDA folder might be the issue? Sadly we are reaching the limits of my knowledge. May have to ask @kwerner or @Ming Chen for their help as they are more familiar with the ins and outs of WRF.

Might also be a netcdf compatibility problem with older netcdf version and the newer WRF model. Perhaps trying the latest netcdf-c version 4.9.0 and netcdf-fortran version 4.6.0 (they are meant to be used together) may solve the problem.
Ok, I will try to repeat the process installing them in completely different folders. If that fails too, I will try to install and use the latest versions of netcdfc and netcdf fortran. I'll keep you posted.
 
Ok, I will try to repeat the process installing them in completely different folders. If that fails too, I will try to install and use the latest versions of netcdfc and netcdf fortran. I'll keep you posted.
Sounds good.
 
Update. I have repeated the process installing WRFPLUS and WRFDA in two different folders (using netCDF4.7.0 and netCdf-Fortran-4.4.5). The output is the same, giving always the same error (undefined reference to "nc*").

However, I tried to compile with an older netCDF version (4.1.3) on another machine (I had this machine readily available for a test while waiting for the installation of more recent netCDF versions on my main machine). Surprisingly, the compilation was successful.

As soon as the more recent netCDF version is installed on the main machine, I will let you know if things work out.
 
Update. I have repeated the process installing WRFPLUS and WRFDA in two different folders (using netCDF4.7.0 and netCdf-Fortran-4.4.5). The output is the same, giving always the same error (undefined reference to "nc*").

However, I tried to compile with an older netCDF version (4.1.3) on another machine (I had this machine readily available for a test while waiting for the installation of more recent netCDF versions on my main machine). Surprisingly, the compilation was successful.

As soon as the more recent netCDF version is installed on the main machine, I will let you know if things work out.
Sounds good, let me know if the newer libraries work
 
Dear Will,

I have finally managed to install netcdf4.9.0 and netcdf-fortran4.6.0 on my main working machines (at last!). I can confirm you that I was able to compile WRFDA with the new libraries. However, I am encountering a problem when trying to run the 4dvar tutorial. The 3dvar tutorial works just fine.

I will probably open a new thread about that.

Thanks once again for your help.

Giorgio
 
Top