NetCDF4 Fortran library may compile successfully and run for simple programs but segfault on programs where HDF5 is linked directly as well as NetCDF4.
This is observed on Ubuntu 18.04 for example.
A reason one might directly link both HDF5 and NetCDF is a program that need to read / write files in HDF5 as well as NetCDF format.
The symptom observe thus far is the program segfault on
An example of a broken Linux system is Ubuntu 18.04.
The fix is to compile HDF5 and NetCDF for yourself.