1. 简介
Compares two NetCDF files in-place to find specific variables, dimensions and/or attributes that differ. Highly recommended for any test-driven environment and regression testing large datasets.
2. 安装环境说明
天河二号,完整安装。
3. 相关软件下载
Hdf5: http://www.hdfgroup.org/HDF5/release/obtainsrc.html#conf
Netcdf-4.3.3: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.3.3.1.tar.gz
Nccmp-1.8.2: http://prdownloads.sourceforge.net/nccmp/nccmp-1.8.2.0.tar.gz
4. 软件编译安装
4.1)编译安装-hdf5
./configure –prefix= /HOME/nsfc2015_567/NSFC/netcdf_comp_test/hdf5_install
Make –j12
Make install
4.2)编译安装-netcdf-4.3.3
4.2.1)首先设置hdf5相关变量(netcdf4.3所需)
HDF=/HOME/nsfc2015_567/NSFC/netcdf_comp_test/hdf5_install
export CFLAGS="-I$HDF/include "
export LDFLAGS="-L$HDF/lib "
4.2.2)编译安装netcdf-4.3.3
./configure prefix=HOME/nsfc2015_567/NSFC/netcdf_comp_test/netcdf_4.3.3_install
Make –j12
Make install
4.3)编译安装-nccmp
4.3.1)设置NC(netcdf相关目录)以及相关变量
NC=HOME/nsfc2015_567/NSFC/netcdf_comp_test/netcdf_4.3.3_install
export CFLAGS="-I$HDF/include -I$NC/include"
export LDFLAGS="-L$HDF/lib -L$NC/lib"
4.3.2)编译安装nccmp:
./configure –prefix=/HOME/nsfc2015_567/NSFC/netcdf_comp_test/nccmp_install –with-netcdf=/HOME/nsfc2015_567/NSFC/netcdf_comp_test/netcdf-4.3.3.1/
注:/HOME/nsfc2015_567/NSFC/netcdf_comp_test/netcdf-4.3.3.1/目录不是netcdf安装目录,而是源码包直接解压的目录。
Make –j12
Make install
4.4)设置环境变量
##~/.bashrc
export LD_LIBRARY_PATH=/HOME/nsfc2015_567/NSFC/netcdf_comp_test/netcdf_4..3_install/lib:$LD_LIBRARY_PATH
export PATH=/HOME/nsfc2015_567/NSFC/netcdf_comp_test/nccmp_install/bin:$PATH
5. 测试(海浪波软件exp1案例)
nccmp -dF -v hs -r 0.01 pac_ncep_wav_20090102.nc ./test/pac_ncep_wav_20090102.nc
部分参数说明:
-d:表示比较变量的value(值)
-F:表示与fortran相关
-t:表示absolute difference
-v:指定比较变量,多个变量用逗号分隔开,如 -v windy,windx
-f:不要比较一次就退出(比较出所有的差异值)
-n:多线程比较,可用于加速,如-n 4
其他功能,请参照nccmp --help.