I suspect a mismatch between the netcdf fortran module (.mod) and the linked library.
The command nc-config reports on what compile and link options are needed, for example:
COAPS 133> nc-config --libs
-L/usr/lib64 -lnetcdf
COAPS 134> nc-config --flibs
-lnetcdff
COAPS 135> nc-config --fflags
-I/usr/include
COAPS 137> which nc-config
/usr/bin/nc-config
The Make_ncdf.csh script copies the .mod files into the current directory:
#
# --- softlink to netCDF module and library
#
/bin/rm -f netcdf.mod libnetcdf.a libnetcdff.a
/bin/rm -f netcdf.inc
/bin/rm -f typesizes.mod
#
ln -s ${NCDFC}/lib/libnetcdf.a .
ln -s ${NCDF}/lib/libnetcdff.a .
ln -s ${NCDF}/include/netcdf.mod .
ln -s ${NCDF}/include/netcdf.inc .
ln -s ${NCDF}/include/typesizes.mod .
This is a holdover from when it was difficult to get .mod and .a files right on the command line.
One work around is to define dummy NCDF and NCDFC in HTCOM-tools/Make_ncdf.src:
#
# --- Generic system with netcdf in system library, dummy NCDF and NCDFC
setenv NCDFC ${HOME}/HYCOM-tools/lib
setenv NCDF ${HOME}/HYCOM-tools/lib
setenv EXTRANCDF "-lnetcdf -lnetcdff"
COAPS 189> pwd
/home/awallcraft/HYCOM-tools/force/src
COAPS 190> ll *.mod
-rw-r--r--. 1 awallcraft awallcraft 8313 Dec 9 2019 mod_scrip.mod
-rw-r--r--. 1 awallcraft awallcraft 713 Dec 9 2019 mod_xc.mod
-rw-r--r--. 1 awallcraft awallcraft 1572 Dec 9 2019 mod_za.mod
lrwxrwxrwx. 1 awallcraft awallcraft 51 Dec 9 2019 netcdf.mod -> /home/awallcraft/HYCOM-tools/lib/include/netcdf.mod
lrwxrwxrwx. 1 awallcraft awallcraft 54 Dec 9 2019 typesizes.mod -> /home/awallcraft/HYCOM-tools/lib/include/typesizes.mod
Where netcdf.mod and typesizes.mod softlinks fail.
But then you need the right compile and link options in your Make_all.src config file:
For example:
FC = gfortran
FCFFLAGS = -g -fPIC -m64 -fno-second-underscore -fconvert=big-endian -O -I/usr/include -I/usr/lib64/gfortran/modules
In this case netcdf.mod is in /usr/lib64/gfortran/modules
You can start by just removing nrl2nc.o and nrl2nc and remaking in the force.src directory. If your new setup works, clean everything and rebuild HYCOM-tools.
Alan.