Download netcdf source code https://downloads.unidata.ucar.edu/netcdf/
Rsync it to the appropriate host
Install dependencies:
sudo dnf install dnf-plugins-core epel-release dpkg libxml2-devel m4 curl-devel sudo dnf -y config-manager --set-enabled powertools sudo dnf -y install hdf5 hdf5-devel hdf5-static
Verify dependency versions:
h5dump -V zlib --version curl --version dnf list installed | grep zlib
Install netcdf:
cd netcdf-c-4.9.2/ ./configure --prefix=/home/pathare/local make check install ./configure --with-zlib=/home/pathare/local --prefix=/home/pathare/local make check install CPPFLAGS=-I/home/pathare/local/include LDFLAGS=-L/home/pathare/local/lib ./configure --prefix=/home/pathare/local make check install
Add environment variables:vim ~/.bashrc
## Add these exports
    export PATH=$PATH:/home/pathare/local/bin
    export NCDIR=/home/pathare/local
    export NFDIR=/hom/pathare/local
    export CPPFLAGS=-I${NCDIR}/include
    export LDFLAGS=-L${NCDIR}/lib
    export LD_LIBRARY_PATH=${NCDIR}/lib:${LD_LIBRARY_PATH}
# Update source
source ~/.bashrc
# Check version
ncdump --version
vim ~/.bashrc
## Add these exports
    export PATH=$PATH:/home/pathare/local/bin
    export NCDIR=/home/pathare/local
    export NFDIR=/hom/pathare/local
    export CPPFLAGS=-I${NCDIR}/include
    export LDFLAGS=-L${NCDIR}/lib
    export LD_LIBRARY_PATH=${NCDIR}/lib:${LD_LIBRARY_PATH}
# Update source
source ~/.bashrc
# Check version
ncdump --versionInstall Netcdf-Fortran Libraries:
Download Fortran libraries https://downloads.unidata.ucar.edu/netcdf/ (scroll down)
Rsync it to the proper host
tar -xf netcdf-fortran-4.6.1.tar.gz 
rm \*.tar.gz
cd netcdf-fortran-4.6.1/
./configure --prefix=${NCDIR}
make check
make install