码迷,mamicode.com
首页 > 其他好文 > 详细

centos 安装 FLEXPART

时间:2018-06-15 00:00:53      阅读:234      评论:0      收藏:0      [点我收藏+]

标签:c++   准备   nts   编译器   gcc-c++   文件   tps   4行   down   

师哥做了个课题,用FLEXPART分析大气伴飞轨迹,提前先安装这个软件吧。我使用的环境是centos7,看官慢慢看,结尾有彩蛋~

准备工作,flexpart是用Fortran语言写的,以.90结尾的文件就是他的源文件,因此编译需要使用gcc和gcc-c++编译器

yum install gcc 

yum install gcc-c++

就行了,gcc编译器可以编译fortran语言的源码

1:安装jasper

cd /usr/local/

 wget http://www.ece.uvic.ca/~mdadams/jasper/software/jasper-1.900.1.zip

unzip jasper-1.900.1.zip

mkdir jasper

cd jasper-1.900.1

./configure --prefix=/usr/local/grib_api --disable-jpeg

make

make check

make install

2:安装grib_api

cd /usr/local/

wget https://software.ecmwf.int/wiki/download/attachments/3473437/grib_api-1.26.1-Source.tar.gz

tar -zxvf grib_api-1.26.1-Source.tar.gz

mkdir grib_api

cd grib_api-1.26.1-Source

./configure --prefix=/usr/local/grib_api

make

make check

make install

3:安装flexpart

cd /usr/local/

wget http://archive.ubuntu.com/ubuntu/pool/universe/f/flexpart/flexpart_9.02.orig.tar.gz

tar -zxvf flexpart_9.02.orig.tar.gz

cd flexpart_9.02

vi makefile.gfs_gfortran

修改

INCPATH = /usr/local/grib_api/include
LIBPATH1 = /usr/local/grib_api/lib
LIBPATH2 = /usr/local/jasper/lib

改完:wq保存喏,改错了记得:q!退出再接着改喏。

 make -f makefile.gfs_gfortran

生成FLEXPART_GFS_GFORTRAN

------------------------------------------------彩蛋------------------------------------------------

你以为这么简单么?其实有个坑,因为在我这个版本的gcc下编译貌似会出错

报错提示在erf.f90 文件的44行有个错,没接触过fortran,但猜测可能是位数不对,于是这么改了一下源代码,编译通过

real(kind=dp) :: x,tmp,ser,xx,gammln

?

real :: gammln

real(kind=dp) :: x,tmp,ser,xx

 

centos 安装 FLEXPART

标签:c++   准备   nts   编译器   gcc-c++   文件   tps   4行   down   

原文地址:https://www.cnblogs.com/marszhw/p/9185319.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!