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

Error when compiling convert_mpas with make

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.


I've searched for this problem to see if it was reported before and haven't find something that looked similar, but sorry if it was already been answered somewhere else.

I am trying to compile convert_mpas with the default option but I get the following error:

View attachment err.txt

I have NetCDF-4.7 installed and, if I'm not mistaken, this is the recommended version for using the MPAS model, so it shouldn't be the problem. I am using mpifort. Does someone knows what could be possibly wrong?
The compilation errors seem to be related to the Parallel-NetCDF library, e.g.,
mpifort -o convert_mpas scan_input.o mpas_mesh.o target_mesh.o remapper.o file_output.o copy_atts.o field_list.o timer.o convert_mpas.o -L/p1-nemo/danilocs/mpas/mpas-libs-gnu8.3.0/lib -lnetcdff -L/p1-nemo/danilocs/mpas/mpas-libs-gnu8.3.0/lib -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lm -lnetcdf -lhdf5_hl -lhdf5 -lz -ldl
/p1-nemo/danilocs/mpas/mpas-libs-gnu8.3.0/lib/libnetcdf.a(libdispatch_la-derror.o): In function `nc_strerror':
/p1-nemo/danilocs/mpas/netcdf-c-4.7.0/libdispatch/derror.c:276: undefined reference to `ncmpi_strerror'
/p1-nemo/danilocs/mpas/netcdf-c-4.7.0/libdispatch/derror.c:277: undefined reference to `ncmpi_strerror'
(Note that the Parallel-NetCDF routines generally begin with "ncmpi_".)

Although the convert_mpas Makefile tries to obtain the correctly library linking flags with
FCLIBS = $(shell nc-config --flibs)
we have found that some versions of the NetCDF library provide an "nc-config" program that don't always return the correct flags (especially regarding the Parallel-NetCDF library).

Can you try adding "-lpnetcdf" to the end of the FCLIBS definition in the top-level Makefile, so that FCLIBS is defined as
FCLIBS = $(shell nc-config --flibs) -lpnetcdf