本文主要是介绍如何在linux上安装netcdf和GMT,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
参考:
http://blog.sina.com.cn/s/blog_872ecf9f0100vlix.html
http://blog.sciencenet.cn/blog-295036-564782.html
安装netcdf
1. 下载
https://www.unidata.ucar.edu/downloads/netcdf/
https://www.unidata.ucar.edu/software/netcdf/release-notes-3.6.3.html
2.
假设源程序包保存在/home/theo/netcdf/netcdf-c-3.6.3文件夹下,打算安装在/usr/local/netcdf路径里。进入root后,操作如下:
mkdir /usr/local/netcdf
cd /home/theo/netcdf/netcdf-c-3.6.3
./configure --prefix=/usr/local/netcdf
make check
make
make install
3
安装完成后,/usr/local/netcdf/文件夹下存在4个文件,分别为bin,include,lib和share。
4
针对感兴趣的某一nc文件,编写相应的fortran代码(如test.f90),其中应包括include 'netcdf.inc',并调用NetCDF给定的函数对nc文件进行读取和写入等操作。
现在安装GMT
下载地址:http://www.scc.u-tokai.ac.jp/gmt/
mkdir /usr/local/GMT
cd GMT4.5.6
./configure --prefix=/usr/local/GMT --enable-netcdf=/usr/local/netcdf(指定刚才netcdf安装路径)
make
make install
拷贝数据文件,进入安装文件夹
sudo cp -r GMT4.5.6/share/ /usr/local/GMT/
sudo cp -r share/coast /usr/local/GMT/share
环境变量及路径设置
vi ~/.bashrc
export GMTHOME=/usr/local/GMT
export PATH=/usr/local/GMT/bin:$PATH
保存退出
这篇关于如何在linux上安装netcdf和GMT的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!