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

ambiguously ignored compilation error related to linking to netcdf library and failed real.exe execution

sdurski

New member
I am building Wrf 4.5 as part of a coupled atmosphere-ocean model, with an intel compiler with mpi parallelization. Although the correct path is specified to netcdf include files, the compilation output (attached) reports a series of errors of not finding netcdf fortran routines like the following

'wrf_io.f:(.text+0x349b): undefined reference to `nf_open_'

I cannot identify what specific step in the build is failing to find those routines. Netcdf environment variables are set, the netcdf install has been built with fortran, and with hdf5 compatibility

The compilation ignores the errors and reaches completion, generating real.exe, but failing to produce wrf.exe. Subsequent attempts to run real.exe result in the following output. This is regardless of what is specified in namelist.input. It can be a file with nothing but a '/' character in it, and real.exe fails in the exact same way.

$ ./real.exe
starting wrf task 0 of 1
module_io_quilt_old.F 2950 T
MPASPECT: UNABLE TO GENERATE PROCESSOR MESH. STOPPING.
MPASPECT: UNABLE TO GENERATE PROCESSOR MESH. STOPPING.
PROCMIN_M 1
PROCMIN_M 1
PROCMIN_N 1
PROCMIN_N 1
P 0
P 0
MINM 1
MINM 1
MINN 0
MINN 0
-------------- FATAL CALLED ---------------
-------------- FATAL CALLED ---------------
FATAL CALLED FROM FILE: <stdin> LINE: 410
FATAL CALLED FROM FILE: <stdin> LINE: 410
module_dm: mpaspect
module_dm: mpaspect
-------------------------------------------
-------------------------------------------

The netcdf specification works for the ocean model which also relies on netcdf fortran libraries to build successfully.

My questions are:
1. can anyone tell me from the config/compile output what specific action is failing. I think errors like this usually just seem to mean a -I path or -Lpath is missing somewhere, but I'm stumped here.
2. Is the failure to seemingly correctly build libwrfio_nf.a impacting the real.exe executable as well as wrf.exe, despite real.exe being built 'successfully?

Any thoughts or suggestions would be greatly appreciated.

Thanks!
 

Attachments

  • comp_err_2.txt
    1.9 MB · Views: 0
  • netcdf_settings.txt
    2.1 KB · Views: 0
I think I've solved this problem for myself. The coupled modeling system I'm using is called COAWST. It has a build script that calls WRF/configure, but it also sets a $NETCDF environment variable. That build script seems to wipe out the $NETCDF path variables that WRF/configure would otherwise properly identify (If the approriate env. vars are specified beforehand.)

For any COAWST users who happen this way, My build_coawst file had a curious setting of

export $NETCDF=${NETCDF_INCDIR}/../'

I guess this is meant, such that you can just set NETCDF_INCDIR in your environment and not have to set $NETCDF. But this is not interpreted correctly in WRF/configure.
Simply eliminating the setting ..or replacing it with the tautology

export $NETCDF=${NETCDF}

and of course still setting $NETCDF, $NETCDF_INCDIR, and $NETCDF_LIBDIR, appropriately in the system environment (outside the build process), was what worked for me.
 
The above solution, solved compilation issues, but did not resolve the real.exe crash associated with being unable to generate a processor mesh. I will ask this with more detail in a new thread.
 
Top