SPOTL安装出现问题解决

SPOTL安装出现问题解决

  • 空间
 

来自http://blog.sciencenet.cn/blog-350278-522672.html,科学网周锋,感谢作者。

SPOTL: Some Programs for Ocean-Tide Loading

源码下载地址:http://igppweb.ucsd.edu/~agnew/Spotl/spotlmain.html

安装平台以ubuntu11.10为例,系统脚本为bash

下载源码并解压,进入spotl/src,修改Makefile

# uncomment the following lines for linux-optimized compilation
FTN = g77
FFLAGS = -O2  -Wunused -Wno-globals -fno-f2c -fno-automatic -fno-backslash -fno-globals
CC = gcc
CFLAGS = -O -c

改为

# uncomment the following lines for linux-optimized compilation
FTN = gfortran
FFLAGS = -O3 -Wuninitialized -fno-f2c -ffast-math -fno-automatic -fno-backslash
CC = gcc
CFLAGS = -O -c

返 回spotl/目录,运行spotl.install文件(./spotl.install),出现错误 ./spotl.install: line 5: Tobinary: command not found,打开spotl.install文件将第5行的Tobinary改为./Tobinary,删掉该目录下的源文件,重新复制源文件到该目录, 将上述两个注意点修改好,重新运行 ./spotl.install,出现错误:

gfortran -O3 -Wuninitialized -fno-f2c -ffast-math -fno-automatic -fno-backslash mapcon.f  -o ../bin/mapcon
rm -f *.o
At line 66 of file mapcon.f (unit = 5, file = 'stdin')
Fortran runtime error: Value overflowed during integer read

此处的Value overflowed即编程中常见的数值溢出,经多次检验,发现是spotl/src目录下的mapcon.f函数下的map变量数值溢出,解决方法是修改spotl/src目录下的mapcon.f函数:

      integer*2 index
      integer*4 map

改为

      integer*4 index
      integer*8 map

因此删除源文件,重新复制源文件,分别对上述提到三处进行修改,即可编译成功,实现SPOTL软件的正确安装。

gfortran -O3 -Wuninitialized -fno-f2c -ffast-math -fno-automatic -fno-backslash mapcon.f  -o ../bin/mapcon
rm -f *.o
 16423 mixed cells written, dimension mapful to    525536
同时查看lndsea目录下生成两个binary文件1.0MB的lndsea.ind和4.3MB的lndsea.bit,而且在working目录下生成一大串快捷方式。

具体用法课参照doc目录下的说明书,bash下环境变量配置可参照:

http://blog.sciencenet.cn/home.php?mod=space&uid=350278&do=blog&id=500879

posted @ 2016-08-19 15:42  alameda  阅读(234)  评论(0)    收藏  举报